diff options
author | Kozoriz <kozorizandriy@gmail.com> | 2016-04-25 16:39:26 +0300 |
---|---|---|
committer | Kozoriz <kozorizandriy@gmail.com> | 2016-04-25 16:39:26 +0300 |
commit | 990bee92cc9d67f9845629bf86e0a700ccc700ce (patch) | |
tree | 2feedfc333dfd6af412db96e189c941b367e08c7 /src/components | |
parent | 388ef32944603a105ed34db4aa089acf5a7a87fd (diff) | |
download | sdl_core-990bee92cc9d67f9845629bf86e0a700ccc700ce.tar.gz |
Code style format with clang-format
Diffstat (limited to 'src/components')
813 files changed, 13989 insertions, 12790 deletions
diff --git a/src/components/application_manager/include/application_manager/application.h b/src/components/application_manager/include/application_manager/application.h index fb48bddb70..959afacc10 100644 --- a/src/components/application_manager/include/application_manager/application.h +++ b/src/components/application_manager/include/application_manager/application.h @@ -338,18 +338,19 @@ class DynamicApplicationData { * * @param Current Interaction layout of the perform interaction */ - virtual void set_perform_interaction_layout(mobile_api::LayoutMode::eType layout) = 0; + virtual void set_perform_interaction_layout( + mobile_api::LayoutMode::eType layout) = 0; - /* - * @brief Retrieve perform interaction layout - */ - 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 Retrieve perform interaction layout */ + 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) + */ virtual void set_perform_interaction_mode(int32_t mode) = 0; /* @@ -443,8 +444,7 @@ class Application : public virtual InitialApplicationData, * @brief Stops streaming service for application * @param service_type Type of streaming service */ - virtual void StopStreaming( - protocol_handler::ServiceType service_type) = 0; + virtual void StopStreaming(protocol_handler::ServiceType service_type) = 0; /** * @brief Stops streaming for application whether it is allowed or not HMI @@ -766,12 +766,13 @@ class Application : public virtual InitialApplicationData, */ virtual void LoadPersistentFiles() = 0; - /** - * @brief Get available app space - * @param name of the app folder(make + mobile app id) - * @return free app space. - */ + /** + * @brief Get available app space + * @param name of the app folder(make + mobile app id) + * @return free app space. + */ virtual uint32_t GetAvailableDiskSpace() = 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 b6653bc3ee..465e4e010a 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 @@ -44,241 +44,244 @@ namespace application_manager { namespace mobile_api = mobile_apis; class InitialApplicationDataImpl : public virtual Application { - public: - InitialApplicationDataImpl(); - ~InitialApplicationDataImpl(); - - const smart_objects::SmartObject* app_types() const; - const smart_objects::SmartObject* vr_synonyms() const; - virtual std::string policy_app_id() const; - const smart_objects::SmartObject* tts_name() const; - const smart_objects::SmartObject* ngn_media_screen_name() const; - const mobile_api::Language::eType& language() const; - const mobile_api::Language::eType& ui_language() const; - void set_app_types(const smart_objects::SmartObject& app_types); - void set_vr_synonyms(const smart_objects::SmartObject& vr_synonyms); - void set_mobile_app_id(const std::string& policy_app_id); - void set_tts_name(const smart_objects::SmartObject& tts_name); - void set_ngn_media_screen_name(const smart_objects::SmartObject& ngn_name); - void set_language(const mobile_api::Language::eType& language); - void set_ui_language(const mobile_api::Language::eType& ui_language); - - void set_perform_interaction_layout( - mobile_api::LayoutMode::eType layout) OVERRIDE; - mobile_api::LayoutMode::eType perform_interaction_layout() const OVERRIDE; - - - protected: - smart_objects::SmartObject* app_types_; - smart_objects::SmartObject* vr_synonyms_; - std::string mobile_app_id_; - smart_objects::SmartObject* tts_name_; - smart_objects::SmartObject* ngn_media_screen_name_; - mobile_api::Language::eType language_; - mobile_api::Language::eType ui_language_; - mobile_apis::LayoutMode::eType perform_interaction_layout_; - private: - DISALLOW_COPY_AND_ASSIGN(InitialApplicationDataImpl); + public: + InitialApplicationDataImpl(); + ~InitialApplicationDataImpl(); + + const smart_objects::SmartObject* app_types() const; + const smart_objects::SmartObject* vr_synonyms() const; + virtual std::string policy_app_id() const; + const smart_objects::SmartObject* tts_name() const; + const smart_objects::SmartObject* ngn_media_screen_name() const; + const mobile_api::Language::eType& language() const; + const mobile_api::Language::eType& ui_language() const; + void set_app_types(const smart_objects::SmartObject& app_types); + void set_vr_synonyms(const smart_objects::SmartObject& vr_synonyms); + void set_mobile_app_id(const std::string& policy_app_id); + void set_tts_name(const smart_objects::SmartObject& tts_name); + void set_ngn_media_screen_name(const smart_objects::SmartObject& ngn_name); + void set_language(const mobile_api::Language::eType& language); + void set_ui_language(const mobile_api::Language::eType& ui_language); + + void set_perform_interaction_layout( + mobile_api::LayoutMode::eType layout) OVERRIDE; + mobile_api::LayoutMode::eType perform_interaction_layout() const OVERRIDE; + + protected: + smart_objects::SmartObject* app_types_; + smart_objects::SmartObject* vr_synonyms_; + std::string mobile_app_id_; + smart_objects::SmartObject* tts_name_; + smart_objects::SmartObject* ngn_media_screen_name_; + mobile_api::Language::eType language_; + mobile_api::Language::eType ui_language_; + mobile_apis::LayoutMode::eType perform_interaction_layout_; + + private: + DISALLOW_COPY_AND_ASSIGN(InitialApplicationDataImpl); }; class DynamicApplicationDataImpl : public virtual Application { - public: - DynamicApplicationDataImpl(); - ~DynamicApplicationDataImpl(); - const smart_objects::SmartObject* help_prompt() const; - const smart_objects::SmartObject* timeout_prompt() const; - const smart_objects::SmartObject* vr_help_title() const; - const smart_objects::SmartObject* vr_help() const; - const mobile_api::TBTState::eType& tbt_state() const; - const smart_objects::SmartObject* show_command() const; - const smart_objects::SmartObject* tbt_show_command() const; - const smart_objects::SmartObject* keyboard_props() const; - const smart_objects::SmartObject* menu_title() const; - const smart_objects::SmartObject* menu_icon() const; - - void load_global_properties(const smart_objects::SmartObject& properties_so); - void set_help_prompt(const smart_objects::SmartObject& help_prompt); - void set_timeout_prompt(const smart_objects::SmartObject& timeout_prompt); - void set_vr_help_title(const smart_objects::SmartObject& vr_help_title); - void reset_vr_help_title(); - void set_vr_help(const smart_objects::SmartObject& vr_help); - void reset_vr_help(); - void set_tbt_state(const mobile_api::TBTState::eType& tbt_state); - void set_show_command(const smart_objects::SmartObject& show_command); - void set_tbt_show_command(const smart_objects::SmartObject& tbt_show); - void set_keyboard_props(const smart_objects::SmartObject& keyboard_props); - void set_menu_title(const smart_objects::SmartObject& menu_title); - void set_menu_icon(const smart_objects::SmartObject& menu_icon); - /* - * @brief Adds a command to the in application menu - */ - void AddCommand(uint32_t cmd_id, - const smart_objects::SmartObject& command); - - /* - * @brief Deletes all commands from the application menu with the specified command id - */ - void RemoveCommand(uint32_t cmd_id); - - /* - * @brief Finds command with the specified command id - */ - smart_objects::SmartObject* FindCommand(uint32_t cmd_id); - - /* - * @brief Adds a menu to the application - */ - void AddSubMenu(uint32_t menu_id, const smart_objects::SmartObject& menu); - - /* - * @brief Deletes menu from the application menu - */ - void RemoveSubMenu(uint32_t menu_id); - - /* - * @brief Finds menu with the specified id - */ - smart_objects::SmartObject* FindSubMenu(uint32_t menu_id) const; - - /* - * @brief Returns true if sub menu with such name already exist - */ - bool IsSubMenuNameAlreadyExist(const std::string& name); - - /* - * @brief Adds a interaction choice set to the application - * - * @param choice_set_id Unique ID used for this interaction choice set - * @param choice_set SmartObject that represent choice set - */ - void AddChoiceSet(uint32_t choice_set_id, - const smart_objects::SmartObject& choice_set); - - /* - * @brief Deletes choice set from the application - * - * @param choice_set_id Unique ID of the interaction choice set - */ - void RemoveChoiceSet(uint32_t choice_set_id); - - /* - * @brief Finds choice set with the specified choice_set_id id - * - * @param choice_set_id Unique ID of the interaction choice set - */ - smart_objects::SmartObject* FindChoiceSet(uint32_t choice_set_id); - - /* - * @brief Adds perform interaction choice set to the application - * - * @param correlation_id Unique ID of the request that added this choice set - * @param choice_set_id Unique ID used for this interaction choice set - * @param choice_set SmartObject that represents choice set - */ - void AddPerformInteractionChoiceSet(uint32_t correlation_id, - uint32_t choice_set_id, const smart_objects::SmartObject& choice_set); - - /* - * @brief Deletes entirely perform interaction choice set map - * @param correlation_id Unique ID of the request that added this choice set - * - */ - void DeletePerformInteractionChoiceSet(uint32_t correlation_id); - - /* - * @brief Retrieves entirely ChoiceSet - VR commands map - * - * @return ChoiceSet map that is currently in use - */ - inline DataAccessor<PerformChoiceSetMap> performinteraction_choice_set_map() const; - - /* - * @brief Retrieve application commands - */ - inline DataAccessor<CommandsMap> commands_map() const; - - /* - * @brief Retrieve application sub menus - */ - inline DataAccessor<SubMenuMap> sub_menu_map() const; - - /* - * @brief Retrieve application choice set map - */ - inline DataAccessor<ChoiceSetMap> choice_set_map() const; - - /* - * @brief Sets perform interaction state - * - * @param active Current state of the perform interaction - */ - void set_perform_interaction_active(uint32_t active); - - /* - * @brief Retrieves perform interaction state - * - * @return TRUE if perform interaction active, otherwise FALSE - */ - inline uint32_t is_perform_interaction_active() const; - - /* - * @brief Sets the mode for perform interaction: UI/VR/BOTH - * - * @param mode Mode that was selected (MENU; VR; BOTH) - */ - void set_perform_interaction_mode(int32_t mode); - - /* - * @brief Retrieve the mode that was PerformInteraction sent in - * - * @return mode of PerformInteraction - */ - inline int32_t perform_interaction_mode() const; - - /* - * @brief Sets reset global properties state - * - * @param active Current state of the reset global properties - */ - void set_reset_global_properties_active(bool active); - - /* - * @brief Retrieves reset global properties state - * - * @return TRUE if perform interaction active, otherwise FALSE - */ - inline bool is_reset_global_properties_active() const; - -protected: - smart_objects::SmartObject* help_prompt_; - smart_objects::SmartObject* timeout_prompt_; - smart_objects::SmartObject* vr_help_title_; - smart_objects::SmartObject* vr_help_; - mobile_api::TBTState::eType tbt_state_; - smart_objects::SmartObject* show_command_; - smart_objects::SmartObject* keyboard_props_; - smart_objects::SmartObject* menu_title_; - smart_objects::SmartObject* menu_icon_; - smart_objects::SmartObject* tbt_show_command_; - - - CommandsMap commands_; - mutable sync_primitives::Lock commands_lock_; - SubMenuMap sub_menu_; - mutable sync_primitives::Lock sub_menu_lock_; - ChoiceSetMap choice_set_map_; - mutable sync_primitives::Lock choice_set_map_lock_; - PerformChoiceSetMap performinteraction_choice_set_map_; - mutable sync_primitives::Lock performinteraction_choice_set_lock_; - uint32_t is_perform_interaction_active_; - bool is_reset_global_properties_active_; - int32_t perform_interaction_mode_; - -private: - void SetGlobalProperties(const smart_objects::SmartObject& param, - void (DynamicApplicationData::*callback)( - const NsSmartDeviceLink::NsSmartObjects::SmartObject&)); - DISALLOW_COPY_AND_ASSIGN(DynamicApplicationDataImpl); + public: + DynamicApplicationDataImpl(); + ~DynamicApplicationDataImpl(); + const smart_objects::SmartObject* help_prompt() const; + const smart_objects::SmartObject* timeout_prompt() const; + const smart_objects::SmartObject* vr_help_title() const; + const smart_objects::SmartObject* vr_help() const; + const mobile_api::TBTState::eType& tbt_state() const; + const smart_objects::SmartObject* show_command() const; + const smart_objects::SmartObject* tbt_show_command() const; + const smart_objects::SmartObject* keyboard_props() const; + const smart_objects::SmartObject* menu_title() const; + const smart_objects::SmartObject* menu_icon() const; + + void load_global_properties(const smart_objects::SmartObject& properties_so); + void set_help_prompt(const smart_objects::SmartObject& help_prompt); + void set_timeout_prompt(const smart_objects::SmartObject& timeout_prompt); + void set_vr_help_title(const smart_objects::SmartObject& vr_help_title); + void reset_vr_help_title(); + void set_vr_help(const smart_objects::SmartObject& vr_help); + void reset_vr_help(); + void set_tbt_state(const mobile_api::TBTState::eType& tbt_state); + void set_show_command(const smart_objects::SmartObject& show_command); + void set_tbt_show_command(const smart_objects::SmartObject& tbt_show); + void set_keyboard_props(const smart_objects::SmartObject& keyboard_props); + void set_menu_title(const smart_objects::SmartObject& menu_title); + void set_menu_icon(const smart_objects::SmartObject& menu_icon); + /* + * @brief Adds a command to the in application menu + */ + void AddCommand(uint32_t cmd_id, const smart_objects::SmartObject& command); + + /* + * @brief Deletes all commands from the application menu with the specified + * command id + */ + void RemoveCommand(uint32_t cmd_id); + + /* + * @brief Finds command with the specified command id + */ + smart_objects::SmartObject* FindCommand(uint32_t cmd_id); + + /* + * @brief Adds a menu to the application + */ + void AddSubMenu(uint32_t menu_id, const smart_objects::SmartObject& menu); + + /* + * @brief Deletes menu from the application menu + */ + void RemoveSubMenu(uint32_t menu_id); + + /* + * @brief Finds menu with the specified id + */ + smart_objects::SmartObject* FindSubMenu(uint32_t menu_id) const; + + /* + * @brief Returns true if sub menu with such name already exist + */ + bool IsSubMenuNameAlreadyExist(const std::string& name); + + /* + * @brief Adds a interaction choice set to the application + * + * @param choice_set_id Unique ID used for this interaction choice set + * @param choice_set SmartObject that represent choice set + */ + void AddChoiceSet(uint32_t choice_set_id, + const smart_objects::SmartObject& choice_set); + + /* + * @brief Deletes choice set from the application + * + * @param choice_set_id Unique ID of the interaction choice set + */ + void RemoveChoiceSet(uint32_t choice_set_id); + + /* + * @brief Finds choice set with the specified choice_set_id id + * + * @param choice_set_id Unique ID of the interaction choice set + */ + smart_objects::SmartObject* FindChoiceSet(uint32_t choice_set_id); + + /* + * @brief Adds perform interaction choice set to the application + * + * @param correlation_id Unique ID of the request that added this choice set + * @param choice_set_id Unique ID used for this interaction choice set + * @param choice_set SmartObject that represents choice set + */ + void AddPerformInteractionChoiceSet( + uint32_t correlation_id, + uint32_t choice_set_id, + const smart_objects::SmartObject& choice_set); + + /* + * @brief Deletes entirely perform interaction choice set map + * @param correlation_id Unique ID of the request that added this choice set + * + */ + void DeletePerformInteractionChoiceSet(uint32_t correlation_id); + + /* + * @brief Retrieves entirely ChoiceSet - VR commands map + * + * @return ChoiceSet map that is currently in use + */ + inline DataAccessor<PerformChoiceSetMap> performinteraction_choice_set_map() + const; + + /* + * @brief Retrieve application commands + */ + inline DataAccessor<CommandsMap> commands_map() const; + + /* + * @brief Retrieve application sub menus + */ + inline DataAccessor<SubMenuMap> sub_menu_map() const; + + /* + * @brief Retrieve application choice set map + */ + inline DataAccessor<ChoiceSetMap> choice_set_map() const; + + /* + * @brief Sets perform interaction state + * + * @param active Current state of the perform interaction + */ + void set_perform_interaction_active(uint32_t active); + + /* + * @brief Retrieves perform interaction state + * + * @return TRUE if perform interaction active, otherwise FALSE + */ + inline uint32_t is_perform_interaction_active() const; + + /* + * @brief Sets the mode for perform interaction: UI/VR/BOTH + * + * @param mode Mode that was selected (MENU; VR; BOTH) + */ + void set_perform_interaction_mode(int32_t mode); + + /* + * @brief Retrieve the mode that was PerformInteraction sent in + * + * @return mode of PerformInteraction + */ + inline int32_t perform_interaction_mode() const; + + /* + * @brief Sets reset global properties state + * + * @param active Current state of the reset global properties + */ + void set_reset_global_properties_active(bool active); + + /* + * @brief Retrieves reset global properties state + * + * @return TRUE if perform interaction active, otherwise FALSE + */ + inline bool is_reset_global_properties_active() const; + + protected: + smart_objects::SmartObject* help_prompt_; + smart_objects::SmartObject* timeout_prompt_; + smart_objects::SmartObject* vr_help_title_; + smart_objects::SmartObject* vr_help_; + mobile_api::TBTState::eType tbt_state_; + smart_objects::SmartObject* show_command_; + smart_objects::SmartObject* keyboard_props_; + smart_objects::SmartObject* menu_title_; + smart_objects::SmartObject* menu_icon_; + smart_objects::SmartObject* tbt_show_command_; + + CommandsMap commands_; + mutable sync_primitives::Lock commands_lock_; + SubMenuMap sub_menu_; + mutable sync_primitives::Lock sub_menu_lock_; + ChoiceSetMap choice_set_map_; + mutable sync_primitives::Lock choice_set_map_lock_; + PerformChoiceSetMap performinteraction_choice_set_map_; + mutable sync_primitives::Lock performinteraction_choice_set_lock_; + uint32_t is_perform_interaction_active_; + bool is_reset_global_properties_active_; + int32_t perform_interaction_mode_; + + private: + void SetGlobalProperties( + const smart_objects::SmartObject& param, + void (DynamicApplicationData::*callback)( + const NsSmartDeviceLink::NsSmartObjects::SmartObject&)); + DISALLOW_COPY_AND_ASSIGN(DynamicApplicationDataImpl); }; DataAccessor<CommandsMap> DynamicApplicationDataImpl::commands_map() const { @@ -295,9 +298,8 @@ DataAccessor<ChoiceSetMap> DynamicApplicationDataImpl::choice_set_map() const { DataAccessor<PerformChoiceSetMap> DynamicApplicationDataImpl::performinteraction_choice_set_map() const { - return DataAccessor<PerformChoiceSetMap>( - performinteraction_choice_set_map_, - performinteraction_choice_set_lock_); + return DataAccessor<PerformChoiceSetMap>(performinteraction_choice_set_map_, + performinteraction_choice_set_lock_); } uint32_t DynamicApplicationDataImpl::is_perform_interaction_active() const { 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 6400b2b3ca..89520de575 100644 --- a/src/components/application_manager/include/application_manager/application_impl.h +++ b/src/components/application_manager/include/application_manager/application_impl.h @@ -106,16 +106,11 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl, bool audio_streaming_allowed() const; void set_audio_streaming_allowed(bool state); - void StartStreaming( - protocol_handler::ServiceType service_type); - void StopStreamingForce( - protocol_handler::ServiceType service_type); - void StopStreaming( - protocol_handler::ServiceType service_type); - void SuspendStreaming( - protocol_handler::ServiceType service_type); - void WakeUpStreaming( - protocol_handler::ServiceType service_type); + void StartStreaming(protocol_handler::ServiceType service_type); + void StopStreamingForce(protocol_handler::ServiceType service_type); + void StopStreaming(protocol_handler::ServiceType service_type); + void SuspendStreaming(protocol_handler::ServiceType service_type); + void WakeUpStreaming(protocol_handler::ServiceType service_type); virtual bool is_voice_communication_supported() const; virtual void set_voice_communication_supported( @@ -193,12 +188,12 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl, #ifdef CUSTOMER_PASA virtual bool flag_sending_hash_change_after_awake() const; virtual void set_flag_sending_hash_change_after_awake(bool flag); -#endif // CUSTOMER_PASA - /** - * @brief Change Hash for current application - * and send notification to mobile - * @return updated_hash - */ +#endif // CUSTOMER_PASA + /** + * @brief Change Hash for current application + * and send notification to mobile + * @return updated_hash + */ virtual void UpdateHash(); UsageStatistics& usage_report(); @@ -299,6 +294,7 @@ class ApplicationImpl : public virtual InitialApplicationDataImpl, * @return free app space. */ uint32_t GetAvailableDiskSpace() OVERRIDE; + protected: /** * @brief Clean up application folder. Persistent files will stay diff --git a/src/components/application_manager/include/application_manager/application_manager.h b/src/components/application_manager/include/application_manager/application_manager.h index 30240b744d..411ecec092 100644 --- a/src/components/application_manager/include/application_manager/application_manager.h +++ b/src/components/application_manager/include/application_manager/application_manager.h @@ -255,7 +255,7 @@ class ApplicationManager { virtual const HMICapabilities& hmi_capabilities() const = 0; virtual void ProcessQueryApp(const smart_objects::SmartObject& sm_object, - const uint32_t connection_key) = 0; + const uint32_t connection_key) = 0; virtual bool is_attenuated_supported() const = 0; @@ -283,182 +283,182 @@ class ApplicationManager { virtual policy::PolicyHandlerInterface& GetPolicyHandler() = 0; virtual uint32_t GetNextHMICorrelationID() = 0; - virtual uint32_t GenerateNewHMIAppID() = 0 ; - - /** - * @brief Ends opened navi services (audio/video) for application - * @param app_id Application id - */ - virtual void EndNaviServices(uint32_t app_id) = 0; - - /* @brief Starts audio passthru process - * - * @return true on success, false if passthru is already in process - */ - virtual bool BeginAudioPassThrough() = 0; - - /* - * @brief Finishes already started audio passthru process - * - * @return true on success, false if passthru is not active - */ - virtual bool EndAudioPassThrough() = 0 ; - - - virtual void ConnectToDevice(const std::string& device_mac) = 0; - - virtual void OnHMIStartedCooperation() = 0 ; - - virtual bool IsHMICooperating() const = 0; - /** - * @brief Notifies all components interested in Vehicle Data update - * i.e. new value of odometer etc and returns list of applications - * subscribed for event. - * @param vehicle_info Enum value of type of vehicle data - * @param new value (for integer values currently) of vehicle data - */ - virtual std::vector<ApplicationSharedPtr> IviInfoUpdated( - VehicleDataType vehicle_info, int value) = 0; - - virtual ApplicationSharedPtr RegisterApplication(const utils::SharedPtr< - smart_objects::SmartObject>& request_for_registration) = 0; - - virtual void SendUpdateAppList() = 0; - - virtual void MarkAppsGreyOut(const connection_handler::DeviceHandle handle, - bool is_greyed_out) = 0; - virtual bool IsAppsQueriedFrom( - const connection_handler::DeviceHandle handle) const = 0; - - virtual bool IsStopping() const = 0; - - virtual void RemoveAppFromTTSGlobalPropertiesList(const uint32_t app_id) = 0; - - virtual mobile_apis::Result::eType SaveBinary(const std::vector<uint8_t>& binary_data, - const std::string& file_path, - const std::string& file_name, - const int64_t offset) = 0; - /* - * @brief Sets SDL access to all mobile apps - * - * @param allowed SDL access to all mobile apps - */ - virtual void SetAllAppsAllowed(const bool allowed) = 0; - - /* - * @brief Sets state for driver distraction - * - * @param state New state to be set - */ - virtual void set_driver_distraction(bool is_distracting) = 0; - - /* - * @brief Starts audio pass thru thread - * - * @param session_key Session key of connection for Mobile side - * @param correlation_id Correlation id for response for Mobile side - * @param max_duration Max duration of audio recording in milliseconds - * @param sampling_rate Value for rate(8, 16, 22, 44 kHz) - * @param bits_per_sample The quality the audio is recorded. - * @param audio_type Type of audio data - */ - virtual void StartAudioPassThruThread(int32_t session_key, - int32_t correlation_id, - int32_t max_duration, - int32_t sampling_rate, - int32_t bits_per_sample, - int32_t audio_type) = 0; - - virtual void StartDevicesDiscovery() = 0; - - virtual void StopAudioPassThru(int32_t application_key) = 0; - - /** - * @brief TerminateRequest forces termination of request - * @param connection_key - application id of request - * @param corr_id correlation id of request - */ - virtual void TerminateRequest(uint32_t connection_key, uint32_t corr_id) = 0; - - /* - * @brief Closes application by id - * - * @param app_id Application id - * @param reason reason of unregistering application - * @param is_resuming describes - is this unregister - * is normal or need to be resumed\ - * @param is_unexpected_disconnect - * Indicates if connection was unexpectedly lost(TM layer, HB) - */ - virtual void UnregisterApplication(const uint32_t& app_id, - mobile_apis::Result::eType reason, - bool is_resuming = false, - bool is_unexpected_disconnect = false) = 0; - - /** - * @ Updates request timeout - * - * @param connection_key Connection key of application - * @param mobile_correlation_id Correlation ID of the mobile request - * @param new_timeout_value New timeout in milliseconds to be set - */ - virtual void updateRequestTimeout(uint32_t connection_key, - uint32_t mobile_correlation_id, - uint32_t new_timeout_value) = 0; - - virtual StateController& state_controller() = 0; - - virtual void SetUnregisterAllApplicationsReason( - mobile_api::AppInterfaceUnregisteredReason::eType reason) = 0; - - /* - * @brief Called on Master_reset or Factory_defaults - * when User chooses to reset HU. - * Resets Policy Table if applicable. - */ - virtual void HeadUnitReset(mobile_api::AppInterfaceUnregisteredReason::eType reason) = 0; - - /** - * @brief Checks HMI level and returns true if streaming is allowed - * @param app_id Application id - * @param service_type Service type to check - * @return True if streaming is allowed, false in other case - */ - virtual bool HMILevelAllowsStreaming( - uint32_t app_id, protocol_handler::ServiceType service_type) const = 0; - - /** - * @brief Checks, if given RPC is allowed at current HMI level for specific - * application in policy table - * @param policy_app_id Application id - * @param hmi_level Current HMI level of application - * @param function_id FunctionID of RPC - * @param params_permissions Permissions for RPC parameters (e.g. - * SubscribeVehicleData) defined in policy table - * @return SUCCESS, if allowed, otherwise result code of check - */ - virtual mobile_apis::Result::eType CheckPolicyPermissions( - const std::string& policy_app_id, - mobile_apis::HMILevel::eType hmi_level, - mobile_apis::FunctionID::eType function_id, - const RPCParams& rpc_params, - CommandParametersPermissions* params_permissions = NULL) = 0; - - - /** - * @brief IsApplicationForbidden allows to distinguish if application is - * not allowed to register, because of spamming. - * - * @param connection_key the connection key ofthe required application - * - * @param policy_app_id application's mobile(policy) identifier. - * - * @return true in case application is allowed to register, false otherwise. - */ - virtual bool IsApplicationForbidden(uint32_t connection_key, - const std::string& policy_app_id) const = 0; - - virtual resumption::ResumeCtrl& resume_controller() = 0 ; + virtual uint32_t GenerateNewHMIAppID() = 0; + + /** + * @brief Ends opened navi services (audio/video) for application + * @param app_id Application id + */ + virtual void EndNaviServices(uint32_t app_id) = 0; + + /* @brief Starts audio passthru process + * + * @return true on success, false if passthru is already in process + */ + virtual bool BeginAudioPassThrough() = 0; + + /* + * @brief Finishes already started audio passthru process + * + * @return true on success, false if passthru is not active + */ + virtual bool EndAudioPassThrough() = 0; + + virtual void ConnectToDevice(const std::string& device_mac) = 0; + + virtual void OnHMIStartedCooperation() = 0; + + virtual bool IsHMICooperating() const = 0; + /** + * @brief Notifies all components interested in Vehicle Data update + * i.e. new value of odometer etc and returns list of applications + * subscribed for event. + * @param vehicle_info Enum value of type of vehicle data + * @param new value (for integer values currently) of vehicle data + */ + virtual std::vector<ApplicationSharedPtr> IviInfoUpdated( + VehicleDataType vehicle_info, int value) = 0; + + virtual ApplicationSharedPtr RegisterApplication(const utils::SharedPtr< + smart_objects::SmartObject>& request_for_registration) = 0; + + virtual void SendUpdateAppList() = 0; + + virtual void MarkAppsGreyOut(const connection_handler::DeviceHandle handle, + bool is_greyed_out) = 0; + virtual bool IsAppsQueriedFrom( + const connection_handler::DeviceHandle handle) const = 0; + + virtual bool IsStopping() const = 0; + + virtual void RemoveAppFromTTSGlobalPropertiesList(const uint32_t app_id) = 0; + + virtual mobile_apis::Result::eType SaveBinary( + const std::vector<uint8_t>& binary_data, + const std::string& file_path, + const std::string& file_name, + const int64_t offset) = 0; + /* + * @brief Sets SDL access to all mobile apps + * + * @param allowed SDL access to all mobile apps + */ + virtual void SetAllAppsAllowed(const bool allowed) = 0; + + /* + * @brief Sets state for driver distraction + * + * @param state New state to be set + */ + virtual void set_driver_distraction(bool is_distracting) = 0; + + /* + * @brief Starts audio pass thru thread + * + * @param session_key Session key of connection for Mobile side + * @param correlation_id Correlation id for response for Mobile side + * @param max_duration Max duration of audio recording in milliseconds + * @param sampling_rate Value for rate(8, 16, 22, 44 kHz) + * @param bits_per_sample The quality the audio is recorded. + * @param audio_type Type of audio data + */ + virtual void StartAudioPassThruThread(int32_t session_key, + int32_t correlation_id, + int32_t max_duration, + int32_t sampling_rate, + int32_t bits_per_sample, + int32_t audio_type) = 0; + + virtual void StartDevicesDiscovery() = 0; + + virtual void StopAudioPassThru(int32_t application_key) = 0; + + /** + * @brief TerminateRequest forces termination of request + * @param connection_key - application id of request + * @param corr_id correlation id of request + */ + virtual void TerminateRequest(uint32_t connection_key, uint32_t corr_id) = 0; + + /* + * @brief Closes application by id + * + * @param app_id Application id + * @param reason reason of unregistering application + * @param is_resuming describes - is this unregister + * is normal or need to be resumed\ + * @param is_unexpected_disconnect + * Indicates if connection was unexpectedly lost(TM layer, HB) + */ + virtual void UnregisterApplication(const uint32_t& app_id, + mobile_apis::Result::eType reason, + bool is_resuming = false, + bool is_unexpected_disconnect = false) = 0; + + /** + * @ Updates request timeout + * + * @param connection_key Connection key of application + * @param mobile_correlation_id Correlation ID of the mobile request + * @param new_timeout_value New timeout in milliseconds to be set + */ + virtual void updateRequestTimeout(uint32_t connection_key, + uint32_t mobile_correlation_id, + uint32_t new_timeout_value) = 0; + + virtual StateController& state_controller() = 0; + + virtual void SetUnregisterAllApplicationsReason( + mobile_api::AppInterfaceUnregisteredReason::eType reason) = 0; + + /* + * @brief Called on Master_reset or Factory_defaults + * when User chooses to reset HU. + * Resets Policy Table if applicable. + */ + virtual void HeadUnitReset( + mobile_api::AppInterfaceUnregisteredReason::eType reason) = 0; + + /** + * @brief Checks HMI level and returns true if streaming is allowed + * @param app_id Application id + * @param service_type Service type to check + * @return True if streaming is allowed, false in other case + */ + virtual bool HMILevelAllowsStreaming( + uint32_t app_id, protocol_handler::ServiceType service_type) const = 0; + + /** + * @brief Checks, if given RPC is allowed at current HMI level for specific + * application in policy table + * @param policy_app_id Application id + * @param hmi_level Current HMI level of application + * @param function_id FunctionID of RPC + * @param params_permissions Permissions for RPC parameters (e.g. + * SubscribeVehicleData) defined in policy table + * @return SUCCESS, if allowed, otherwise result code of check + */ + virtual mobile_apis::Result::eType CheckPolicyPermissions( + const std::string& policy_app_id, + mobile_apis::HMILevel::eType hmi_level, + mobile_apis::FunctionID::eType function_id, + const RPCParams& rpc_params, + CommandParametersPermissions* params_permissions = NULL) = 0; + + /** + * @brief IsApplicationForbidden allows to distinguish if application is + * not allowed to register, because of spamming. + * + * @param connection_key the connection key ofthe required application + * + * @param policy_app_id application's mobile(policy) identifier. + * + * @return true in case application is allowed to register, false otherwise. + */ + virtual bool IsApplicationForbidden( + uint32_t connection_key, const std::string& policy_app_id) const = 0; + + virtual resumption::ResumeCtrl& resume_controller() = 0; /* * @brief Converts connection string transport type representation * to HMI Common_TransportType @@ -467,62 +467,61 @@ class ApplicationManager { * * @return Corresponding HMI TransporType value */ - virtual hmi_apis::Common_TransportType::eType GetDeviceTransportType( + virtual hmi_apis::Common_TransportType::eType GetDeviceTransportType( const std::string& transport_type) = 0; - /** - * @brief method adds application - * to tts_global_properties_app_list_ - * @param app_id contains application which will - * send TTS global properties after timeout - */ - virtual void AddAppToTTSGlobalPropertiesList(const uint32_t app_id) = 0; + /** + * @brief method adds application + * to tts_global_properties_app_list_ + * @param app_id contains application which will + * send TTS global properties after timeout + */ + virtual void AddAppToTTSGlobalPropertiesList(const uint32_t app_id) = 0; - /** - * Generate grammar ID - * - * @return New grammar ID - */ - virtual uint32_t GenerateGrammarID() = 0; - - virtual policy::DeviceConsent GetUserConsentForDevice( - const std::string& device_id) const = 0; - - /** - * @brief Handle sequence for unauthorized application - * @param app_id Application id - */ - virtual void OnAppUnauthorized(const uint32_t& app_id) = 0; - - virtual bool ActivateApplication(ApplicationSharedPtr app) = 0; - - /** - * @brief Callback calls when application starts/stops data streaming - * @param app_id Streaming application id - * @param service_type Streaming service type - * @param state Shows if streaming started or stopped - */ - virtual void OnAppStreaming(uint32_t app_id, - protocol_handler::ServiceType service_type, - bool state) = 0; - - - /** - * @brief CreateRegularState create regular HMI state for application - * @param app_id - * @param hmi_level of returned state - * @param audio_state of returned state - * @param system_context of returned state - * @return new regular HMI state - */ - virtual HmiStatePtr CreateRegularState( - uint32_t app_id, - mobile_apis::HMILevel::eType hmi_level, - mobile_apis::AudioStreamingState::eType audio_state, - mobile_apis::SystemContext::eType system_context) const = 0; - - virtual void SendAudioPassThroughNotification(uint32_t session_key, - std::vector<uint8_t>& binary_data) = 0; + /** + * Generate grammar ID + * + * @return New grammar ID + */ + virtual uint32_t GenerateGrammarID() = 0; + + virtual policy::DeviceConsent GetUserConsentForDevice( + const std::string& device_id) const = 0; + + /** + * @brief Handle sequence for unauthorized application + * @param app_id Application id + */ + virtual void OnAppUnauthorized(const uint32_t& app_id) = 0; + + virtual bool ActivateApplication(ApplicationSharedPtr app) = 0; + + /** + * @brief Callback calls when application starts/stops data streaming + * @param app_id Streaming application id + * @param service_type Streaming service type + * @param state Shows if streaming started or stopped + */ + virtual void OnAppStreaming(uint32_t app_id, + protocol_handler::ServiceType service_type, + bool state) = 0; + + /** + * @brief CreateRegularState create regular HMI state for application + * @param app_id + * @param hmi_level of returned state + * @param audio_state of returned state + * @param system_context of returned state + * @return new regular HMI state + */ + virtual HmiStatePtr CreateRegularState( + uint32_t app_id, + mobile_apis::HMILevel::eType hmi_level, + mobile_apis::AudioStreamingState::eType audio_state, + mobile_apis::SystemContext::eType system_context) const = 0; + + virtual void SendAudioPassThroughNotification( + uint32_t session_key, std::vector<uint8_t>& binary_data) = 0; /** * @brief Checks if application can stream (streaming service is started and @@ -531,19 +530,18 @@ class ApplicationManager { * @param service_type Service type to check * @return True if streaming is allowed, false in other case */ - virtual bool CanAppStream(uint32_t app_id, - protocol_handler::ServiceType service_type) const = 0; - - /** - * @brief ForbidStreaming forbid the stream over the certain application. - * @param app_id the application's id which should stop streaming. - */ - virtual void ForbidStreaming(uint32_t app_id) = 0; + virtual bool CanAppStream( + uint32_t app_id, protocol_handler::ServiceType service_type) const = 0; - virtual const ApplicationManagerSettings& get_settings() const = 0; + /** + * @brief ForbidStreaming forbid the stream over the certain application. + * @param app_id the application's id which should stop streaming. + */ + virtual void ForbidStreaming(uint32_t app_id) = 0; - virtual event_engine::EventDispatcher& event_dispatcher() = 0; + virtual const ApplicationManagerSettings& get_settings() const = 0; + virtual event_engine::EventDispatcher& event_dispatcher() = 0; }; } // namespace application_manager 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 6da96306d1..91b0f3f86f 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 @@ -208,9 +208,10 @@ class ApplicationManagerImpl public impl::ToHmiQueue::Handler, public impl::AudioPassThruQueue::Handler #ifdef TELEMETRY_MONITOR - , public telemetry_monitor::TelemetryObservable<AMTelemetryObserver> + , + public telemetry_monitor::TelemetryObservable<AMTelemetryObserver> #endif // TELEMETRY_MONITOR -{ + { friend class ResumeCtrl; friend class CommandImpl; @@ -669,8 +670,8 @@ class ApplicationManagerImpl * * @param binary_data AudioPassThru data chunk */ - void SendAudioPassThroughNotification(uint32_t session_key, - std::vector<uint8_t>& binary_data) OVERRIDE; + void SendAudioPassThroughNotification( + uint32_t session_key, std::vector<uint8_t>& binary_data) OVERRIDE; std::string GetDeviceName(connection_handler::DeviceHandle handle); @@ -708,7 +709,7 @@ class ApplicationManagerImpl * @param connection_key - application id of request * @param corr_id correlation id of request */ - void TerminateRequest(uint32_t connection_key, uint32_t corr_id)OVERRIDE; + void TerminateRequest(uint32_t connection_key, uint32_t corr_id) OVERRIDE; // Overriden ProtocolObserver method void OnMessageReceived( const ::protocol_handler::RawMessagePtr message) OVERRIDE; @@ -837,7 +838,7 @@ class ApplicationManagerImpl * Getter for resume_controller * @return Resume Controller */ - resumption::ResumeCtrl& resume_controller() OVERRIDE{ + resumption::ResumeCtrl& resume_controller() OVERRIDE { return resume_ctrl_; } @@ -853,7 +854,7 @@ class ApplicationManagerImpl * * @return New HMI application ID */ - uint32_t GenerateNewHMIAppID()OVERRIDE; + uint32_t GenerateNewHMIAppID() OVERRIDE; /** * @brief Parse smartObject and replace mobile app Id by HMI app ID @@ -939,7 +940,7 @@ class ApplicationManagerImpl protocol_handler::ProtocolHandler& protocol_handler() const OVERRIDE; virtual policy::PolicyHandlerInterface& GetPolicyHandler() OVERRIDE { - return policy_handler_; + return policy_handler_; } /** * @brief Checks, if given RPC is allowed at current HMI level for specific @@ -1097,7 +1098,8 @@ class ApplicationManagerImpl * @param handle, Device handle * @return true, if list had been queried already, otherwise - false */ - bool IsAppsQueriedFrom(const connection_handler::DeviceHandle handle) const OVERRIDE; + bool IsAppsQueriedFrom( + const connection_handler::DeviceHandle handle) const OVERRIDE; bool IsStopping() const OVERRIDE { return is_stopping_; @@ -1107,7 +1109,7 @@ class ApplicationManagerImpl const ApplicationManagerSettings& get_settings() const OVERRIDE; virtual event_engine::EventDispatcher& event_dispatcher() OVERRIDE; -private: + private: /** * @brief PullLanguagesInfo allows to pull information about languages. * @@ -1187,8 +1189,11 @@ private: smart_objects::SmartObject hmi_application(smart_objects::SmartType_Map); const protocol_handler::SessionObserver& session_observer = connection_handler().get_session_observer(); - if (MessageHelper::CreateHMIApplicationStruct( - *it, session_observer, GetPolicyHandler(), &hmi_application, app_mngr)) { + if (MessageHelper::CreateHMIApplicationStruct(*it, + session_observer, + GetPolicyHandler(), + &hmi_application, + app_mngr)) { applications[app_count++] = hmi_application; } else { LOG4CXX_DEBUG(logger_, "Can't CreateHMIApplicationStruct "); 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 17c9bcb64b..fb2bc6d78f 100644 --- a/src/components/application_manager/include/application_manager/commands/command.h +++ b/src/components/application_manager/include/application_manager/commands/command.h @@ -108,17 +108,13 @@ class Command { */ 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 CommandOrigin { - ORIGIN_SDL, - ORIGIN_MOBILE - }; + enum CommandOrigin { ORIGIN_SDL, ORIGIN_MOBILE }; }; 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 037de899e4..439b1756ef 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 @@ -63,7 +63,7 @@ class CommandImpl : public Command { * @param message Incoming SmartObject message **/ CommandImpl(const MessageSharedPtr& message, - ApplicationManager& application_manager); + ApplicationManager& application_manager); /** * @brief CommandImpl class destructor @@ -138,7 +138,7 @@ class CommandImpl : public Command { // members static const int32_t hmi_protocol_type_; static const int32_t mobile_protocol_type_; - static const int32_t protocol_version_; + static const int32_t protocol_version_; protected: /** @@ -162,11 +162,10 @@ class CommandImpl : public Command { #ifdef ENABLE_LOG static log4cxx::LoggerPtr logger_; -#endif // ENABLE_LOG +#endif // ENABLE_LOG private: DISALLOW_COPY_AND_ASSIGN(CommandImpl); - }; } // namespace commands 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 242f9f28f4..2f3b809274 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 @@ -48,12 +48,13 @@ namespace commands { class CommandNotificationFromMobileImpl : public CommandImpl { public: CommandNotificationFromMobileImpl(const MessageSharedPtr& message, - ApplicationManager& application_manager); + ApplicationManager& application_manager); virtual ~CommandNotificationFromMobileImpl(); virtual bool Init(); virtual bool CleanUp(); virtual void Run(); void SendNotification(); + private: DISALLOW_COPY_AND_ASSIGN(CommandNotificationFromMobileImpl); }; diff --git a/src/components/application_manager/include/application_manager/commands/command_notification_impl.h b/src/components/application_manager/include/application_manager/commands/command_notification_impl.h index cebb0d3944..25a2a18aca 100644 --- a/src/components/application_manager/include/application_manager/commands/command_notification_impl.h +++ b/src/components/application_manager/include/application_manager/commands/command_notification_impl.h @@ -48,12 +48,13 @@ namespace commands { class CommandNotificationImpl : public CommandImpl { public: CommandNotificationImpl(const MessageSharedPtr& message, - ApplicationManager& application_manager); + ApplicationManager& application_manager); virtual ~CommandNotificationImpl(); virtual bool Init(); virtual bool CleanUp(); virtual void Run(); void SendNotification(); + private: DISALLOW_COPY_AND_ASSIGN(CommandNotificationImpl); }; 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 1ddbdd9fc4..02623cb4d2 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 @@ -55,7 +55,7 @@ class CommandRequestImpl : public CommandImpl, enum RequestState { kAwaitingHMIResponse = 0, kTimedOut, kCompleted }; CommandRequestImpl(const MessageSharedPtr& message, - ApplicationManager& application_manager); + ApplicationManager& application_manager); virtual ~CommandRequestImpl(); virtual bool CheckPermissions(); virtual bool Init(); diff --git a/src/components/application_manager/include/application_manager/commands/command_response_impl.h b/src/components/application_manager/include/application_manager/commands/command_response_impl.h index 665fede84a..2b52ea5a58 100644 --- a/src/components/application_manager/include/application_manager/commands/command_response_impl.h +++ b/src/components/application_manager/include/application_manager/commands/command_response_impl.h @@ -49,7 +49,7 @@ namespace commands { class CommandResponseImpl : public CommandImpl { public: CommandResponseImpl(const MessageSharedPtr& message, - ApplicationManager& application_manager); + ApplicationManager& application_manager); virtual ~CommandResponseImpl(); virtual bool Init(); virtual bool CleanUp(); @@ -58,6 +58,7 @@ class CommandResponseImpl : public CommandImpl { const mobile_apis::Result::eType& result_code = mobile_apis::Result::INVALID_ENUM, bool final_message = false); + private: DISALLOW_COPY_AND_ASSIGN(CommandResponseImpl); }; diff --git a/src/components/application_manager/include/application_manager/commands/hmi/activate_app_request.h b/src/components/application_manager/include/application_manager/commands/hmi/activate_app_request.h index d92ad0cac3..090a77b9ed 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/activate_app_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/activate_app_request.h @@ -43,26 +43,27 @@ namespace commands { * @brief ActivateAppRequest command class **/ class ActivateAppRequest : public RequestToHMI { - public: - /** - * @brief ActivateAppRequest class constructor - * - * @param message Incoming SmartObject message - **/ - ActivateAppRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + public: + /** + * @brief ActivateAppRequest class constructor + * + * @param message Incoming SmartObject message + **/ + ActivateAppRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief ActivateAppRequest class destructor - **/ - virtual ~ActivateAppRequest(); + /** + * @brief ActivateAppRequest class destructor + **/ + virtual ~ActivateAppRequest(); - /** - * @brief Execute command - **/ - virtual void Run(); + /** + * @brief Execute command + **/ + virtual void Run(); - private: - DISALLOW_COPY_AND_ASSIGN(ActivateAppRequest); + private: + DISALLOW_COPY_AND_ASSIGN(ActivateAppRequest); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/activate_app_response.h b/src/components/application_manager/include/application_manager/commands/hmi/activate_app_response.h index 1e008c4525..471de1135e 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/activate_app_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/activate_app_response.h @@ -43,26 +43,27 @@ namespace commands { * @brief ActivateAppResponse command class **/ class ActivateAppResponse : public ResponseFromHMI { - public: - /** - * @brief ActivateAppResponse class constructor - * - * @param message Incoming SmartObject message - **/ - ActivateAppResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + public: + /** + * @brief ActivateAppResponse class constructor + * + * @param message Incoming SmartObject message + **/ + ActivateAppResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief ActivateAppResponse class destructor - **/ - virtual ~ActivateAppResponse(); + /** + * @brief ActivateAppResponse class destructor + **/ + virtual ~ActivateAppResponse(); - /** - * @brief Execute command - **/ - virtual void Run(); + /** + * @brief Execute command + **/ + virtual void Run(); - private: - DISALLOW_COPY_AND_ASSIGN(ActivateAppResponse); + private: + DISALLOW_COPY_AND_ASSIGN(ActivateAppResponse); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/add_statistics_info_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/add_statistics_info_notification.h index ce7670910a..3e0f81f167 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/add_statistics_info_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/add_statistics_info_notification.h @@ -49,7 +49,8 @@ class AddStatisticsInfoNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - AddStatisticsInfoNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + AddStatisticsInfoNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief AddStatisticsInfoNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/allow_all_apps_request.h b/src/components/application_manager/include/application_manager/commands/hmi/allow_all_apps_request.h index 8ebf7d203f..c1c5b36e5b 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/allow_all_apps_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/allow_all_apps_request.h @@ -49,7 +49,8 @@ class AllowAllAppsRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - AllowAllAppsRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + AllowAllAppsRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief AllowAllAppsRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/allow_all_apps_response.h b/src/components/application_manager/include/application_manager/commands/hmi/allow_all_apps_response.h index 36ffb7afd1..711825cfab 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/allow_all_apps_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/allow_all_apps_response.h @@ -49,7 +49,8 @@ class AllowAllAppsResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - AllowAllAppsResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + AllowAllAppsResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief AllowAllAppsResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/allow_app_request.h b/src/components/application_manager/include/application_manager/commands/hmi/allow_app_request.h index 7611272a6d..10424a2661 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/allow_app_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/allow_app_request.h @@ -49,7 +49,8 @@ class AllowAppRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - AllowAppRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + AllowAppRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief AllowAppRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/allow_app_response.h b/src/components/application_manager/include/application_manager/commands/hmi/allow_app_response.h index 72adc5b4e7..4f2642f550 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/allow_app_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/allow_app_response.h @@ -49,7 +49,8 @@ class AllowAppResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - AllowAppResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + AllowAppResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief AllowAppResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_system_request.h b/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_system_request.h index 81d230796a..d9aaff7797 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_system_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_system_request.h @@ -43,26 +43,27 @@ namespace commands { * @brief BasicCommunicationSystemRequest command class **/ class BasicCommunicationSystemRequest : public RequestToHMI { - public: - /** - * @brief BasicCommunicationSystemRequest class constructor - * - * @param message Incoming SmartObject message - **/ - BasicCommunicationSystemRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + public: + /** + * @brief BasicCommunicationSystemRequest class constructor + * + * @param message Incoming SmartObject message + **/ + BasicCommunicationSystemRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief BasicCommunicationSystemRequest class destructor - **/ - virtual ~BasicCommunicationSystemRequest(); + /** + * @brief BasicCommunicationSystemRequest class destructor + **/ + virtual ~BasicCommunicationSystemRequest(); - /** - * @brief Execute command - **/ - virtual void Run(); + /** + * @brief Execute command + **/ + virtual void Run(); - private: - DISALLOW_COPY_AND_ASSIGN(BasicCommunicationSystemRequest); + private: + DISALLOW_COPY_AND_ASSIGN(BasicCommunicationSystemRequest); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_system_response.h b/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_system_response.h index d7c4e1572a..b7d4f8f689 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_system_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/basic_communication_system_response.h @@ -43,26 +43,27 @@ namespace commands { * @brief BasicCommunicationSystemResponse command class **/ class BasicCommunicationSystemResponse : public ResponseFromHMI { - public: - /** - * @brief BasicCommunicationSystemResponse class constructor - * - * @param message Incoming SmartObject message - **/ - BasicCommunicationSystemResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + public: + /** + * @brief BasicCommunicationSystemResponse class constructor + * + * @param message Incoming SmartObject message + **/ + BasicCommunicationSystemResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief BasicCommunicationSystemResponse class destructor - **/ - virtual ~BasicCommunicationSystemResponse(); + /** + * @brief BasicCommunicationSystemResponse class destructor + **/ + virtual ~BasicCommunicationSystemResponse(); - /** - * @brief Execute command - **/ - virtual void Run(); + /** + * @brief Execute command + **/ + virtual void Run(); - private: - DISALLOW_COPY_AND_ASSIGN(BasicCommunicationSystemResponse); + private: + DISALLOW_COPY_AND_ASSIGN(BasicCommunicationSystemResponse); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/button_get_capabilities_request.h b/src/components/application_manager/include/application_manager/commands/hmi/button_get_capabilities_request.h index 40782043bd..45dc690c6c 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/button_get_capabilities_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/button_get_capabilities_request.h @@ -49,7 +49,8 @@ class ButtonGetCapabilitiesRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - ButtonGetCapabilitiesRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + ButtonGetCapabilitiesRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief ButtonGetCapabilitiesRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/button_get_capabilities_response.h b/src/components/application_manager/include/application_manager/commands/hmi/button_get_capabilities_response.h index 1ad88d61c4..4efa576079 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/button_get_capabilities_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/button_get_capabilities_response.h @@ -49,7 +49,8 @@ class ButtonGetCapabilitiesResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - ButtonGetCapabilitiesResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + ButtonGetCapabilitiesResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief ButtonGetCapabilitiesResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/close_popup_request.h b/src/components/application_manager/include/application_manager/commands/hmi/close_popup_request.h index 70ea502cbd..d7d4d18d97 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/close_popup_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/close_popup_request.h @@ -49,7 +49,8 @@ class ClosePopupRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - ClosePopupRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + ClosePopupRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief ClosePopupRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/close_popup_response.h b/src/components/application_manager/include/application_manager/commands/hmi/close_popup_response.h index 14d4e6d24e..6dccad7b57 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/close_popup_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/close_popup_response.h @@ -49,7 +49,8 @@ class ClosePopupResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - ClosePopupResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + ClosePopupResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief ClosePopupResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/dial_number_request.h b/src/components/application_manager/include/application_manager/commands/hmi/dial_number_request.h index 34581042ea..2b002c31dd 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/dial_number_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/dial_number_request.h @@ -50,7 +50,8 @@ class DialNumberRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - DialNumberRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + DialNumberRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief DialNumberRequest class destructor @@ -66,7 +67,7 @@ class DialNumberRequest : public RequestToHMI { DISALLOW_COPY_AND_ASSIGN(DialNumberRequest); }; -} // namespace hmi +} // namespace hmi } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/dial_number_response.h b/src/components/application_manager/include/application_manager/commands/hmi/dial_number_response.h index 0311e85255..1fbef15307 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/dial_number_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/dial_number_response.h @@ -51,7 +51,8 @@ class DialNumberResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - DialNumberResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + DialNumberResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief DialNumberResponse class destructor @@ -67,7 +68,7 @@ class DialNumberResponse : public ResponseFromHMI { DISALLOW_COPY_AND_ASSIGN(DialNumberResponse); }; -} // namespace hmi +} // namespace hmi } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/get_system_info_request.h b/src/components/application_manager/include/application_manager/commands/hmi/get_system_info_request.h index 0d20210c0f..f4e421473c 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/get_system_info_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/get_system_info_request.h @@ -43,26 +43,27 @@ namespace commands { * @brief GetSystemInfoRequest command class **/ class GetSystemInfoRequest : public RequestToHMI { - public: - /** - * @brief GetSystemInfoRequest class constructor - * - * @param message Incoming SmartObject message - **/ - GetSystemInfoRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + public: + /** + * @brief GetSystemInfoRequest class constructor + * + * @param message Incoming SmartObject message + **/ + GetSystemInfoRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief GetSystemInfoRequest class destructor - **/ - virtual ~GetSystemInfoRequest(); + /** + * @brief GetSystemInfoRequest class destructor + **/ + virtual ~GetSystemInfoRequest(); - /** - * @brief Execute command - **/ - virtual void Run(); + /** + * @brief Execute command + **/ + virtual void Run(); - private: - DISALLOW_COPY_AND_ASSIGN(GetSystemInfoRequest); + private: + DISALLOW_COPY_AND_ASSIGN(GetSystemInfoRequest); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/get_system_info_response.h b/src/components/application_manager/include/application_manager/commands/hmi/get_system_info_response.h index 72de924bcf..766a2869d9 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/get_system_info_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/get_system_info_response.h @@ -50,28 +50,30 @@ struct SystemInfo { * @brief GetSystemInfoResponse command class **/ class GetSystemInfoResponse : public ResponseFromHMI { - public: - /** - * @brief GetSystemInfoResponse class constructor - * - * @param message Incoming SmartObject message - **/ - GetSystemInfoResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + public: + /** + * @brief GetSystemInfoResponse class constructor + * + * @param message Incoming SmartObject message + **/ + GetSystemInfoResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief GetSystemInfoResponse class destructor - **/ - virtual ~GetSystemInfoResponse(); + /** + * @brief GetSystemInfoResponse class destructor + **/ + virtual ~GetSystemInfoResponse(); - /** - * @brief Execute command - **/ - virtual void Run(); + /** + * @brief Execute command + **/ + virtual void Run(); - private: - const SystemInfo GetSystemInfo(const hmi_apis::Common_Result::eType code) const; + private: + const SystemInfo GetSystemInfo( + const hmi_apis::Common_Result::eType code) const; - DISALLOW_COPY_AND_ASSIGN(GetSystemInfoResponse); + DISALLOW_COPY_AND_ASSIGN(GetSystemInfoResponse); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/get_urls.h b/src/components/application_manager/include/application_manager/commands/hmi/get_urls.h index 1e9445cce7..3346f6672b 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/get_urls.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/get_urls.h @@ -42,26 +42,27 @@ namespace commands { * @brief GetUrls command class **/ class GetUrls : public RequestFromHMI { - public: - /** - * @brief GetUrls class constructor - * - * @param message Incoming SmartObject message - **/ - GetUrls(const MessageSharedPtr& message, ApplicationManager& application_manager); + public: + /** + * @brief GetUrls class constructor + * + * @param message Incoming SmartObject message + **/ + GetUrls(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief GetUrls class destructor - **/ - virtual ~GetUrls(); + /** + * @brief GetUrls class destructor + **/ + virtual ~GetUrls(); - /** - * @brief Execute command - **/ - virtual void Run(); + /** + * @brief Execute command + **/ + virtual void Run(); - private: - DISALLOW_COPY_AND_ASSIGN(GetUrls); + private: + DISALLOW_COPY_AND_ASSIGN(GetUrls); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/get_urls_response.h b/src/components/application_manager/include/application_manager/commands/hmi/get_urls_response.h index 6486033c68..1ca9ba93db 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/get_urls_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/get_urls_response.h @@ -39,26 +39,27 @@ namespace application_manager { namespace commands { class GetUrlsResponse : public ResponseToHMI { - public: - /** - * @brief GetUrlsResponse class constructor - * - * @param message Incoming SmartObject message - **/ - GetUrlsResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + public: + /** + * @brief GetUrlsResponse class constructor + * + * @param message Incoming SmartObject message + **/ + GetUrlsResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief GetUrlsResponse class destructor - **/ - virtual ~GetUrlsResponse(); + /** + * @brief GetUrlsResponse class destructor + **/ + virtual ~GetUrlsResponse(); - /** - * @brief Execute command - **/ - virtual void Run(); + /** + * @brief Execute command + **/ + virtual void Run(); - private: - DISALLOW_COPY_AND_ASSIGN(GetUrlsResponse); + private: + DISALLOW_COPY_AND_ASSIGN(GetUrlsResponse); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/mixing_audio_supported_request.h b/src/components/application_manager/include/application_manager/commands/hmi/mixing_audio_supported_request.h index 3c5a060c2a..4989208f7a 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/mixing_audio_supported_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/mixing_audio_supported_request.h @@ -49,7 +49,8 @@ class MixingAudioSupportedRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - MixingAudioSupportedRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + MixingAudioSupportedRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief MixingAudioSupportedRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/mixing_audio_supported_response.h b/src/components/application_manager/include/application_manager/commands/hmi/mixing_audio_supported_response.h index 0ddfd2a65e..a0cf89f558 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/mixing_audio_supported_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/mixing_audio_supported_response.h @@ -49,7 +49,8 @@ class MixingAudioSupportedResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - MixingAudioSupportedResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + MixingAudioSupportedResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief MixingAudioSupportedResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_alert_maneuver_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_alert_maneuver_request.h index c883995eb4..123c0ab0d6 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/navi_alert_maneuver_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_alert_maneuver_request.h @@ -49,7 +49,8 @@ class NaviAlertManeuverRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - NaviAlertManeuverRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + NaviAlertManeuverRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief NaviAlertManeuverRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_alert_maneuver_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_alert_maneuver_response.h index 9d343f2aaa..d4a57e9e2f 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/navi_alert_maneuver_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_alert_maneuver_response.h @@ -49,7 +49,8 @@ class NaviAlertManeuverResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - NaviAlertManeuverResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + NaviAlertManeuverResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief NaviAlertManeuverResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_start_stream_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_start_stream_request.h index 44ffea5310..d6f4fd36e2 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_start_stream_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_start_stream_request.h @@ -50,19 +50,19 @@ class AudioStartStreamRequest : public RequestToHMI, * * @param message Incoming SmartObject message **/ - AudioStartStreamRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + AudioStartStreamRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnNaviStartStreamRequest class destructor **/ virtual ~AudioStartStreamRequest(); - /** - * @brief onTimeOut from requrst Controller - */ + /** + * @brief onTimeOut from requrst Controller + */ virtual void onTimeOut(); - /** * @brief Execute command **/ @@ -73,13 +73,13 @@ class AudioStartStreamRequest : public RequestToHMI, **/ virtual void on_event(const 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: + private: uint32_t retry_number_; DISALLOW_COPY_AND_ASSIGN(AudioStartStreamRequest); }; diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_start_stream_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_start_stream_response.h index aa87da1329..485b510bf2 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_start_stream_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_start_stream_response.h @@ -48,7 +48,8 @@ class AudioStartStreamResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - AudioStartStreamResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + AudioStartStreamResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief AudioStartStreamResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_stop_stream_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_stop_stream_request.h index f3d2b4bb89..3a21e3e827 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_stop_stream_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_stop_stream_request.h @@ -48,7 +48,8 @@ class AudioStopStreamRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - AudioStopStreamRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + AudioStopStreamRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief NaviStopStreamRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_stop_stream_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_stop_stream_response.h index 69e1c7cd5e..ce32d5b627 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_stop_stream_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_audio_stop_stream_response.h @@ -48,7 +48,8 @@ class AudioStopStreamResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - AudioStopStreamResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + AudioStopStreamResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnNaviStopStreamResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_get_way_points_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_get_way_points_request.h index 57c24aeff7..33c5dfe2db 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/navi_get_way_points_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_get_way_points_request.h @@ -42,31 +42,30 @@ namespace commands { /** * @brief NaviGetWayPointsRequest command class **/ -class NaviGetWayPointsRequest - : public RequestToHMI { -public: - /** - * @brief NaviGetWayPointsRequest class constructor - * - * @param message Incoming SmartObject message - **/ - NaviGetWayPointsRequest(const MessageSharedPtr& message, - ApplicationManager& application_manager); - /** - * @brief NaviGetWayPointsRequest class destructor - **/ - virtual ~NaviGetWayPointsRequest(); - /** - * @brief Execute command - **/ - virtual void Run() OVERRIDE; +class NaviGetWayPointsRequest : public RequestToHMI { + public: + /** + * @brief NaviGetWayPointsRequest class constructor + * + * @param message Incoming SmartObject message + **/ + NaviGetWayPointsRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); + /** + * @brief NaviGetWayPointsRequest class destructor + **/ + virtual ~NaviGetWayPointsRequest(); + /** + * @brief Execute command + **/ + virtual void Run() OVERRIDE; -private: + private: DISALLOW_COPY_AND_ASSIGN(NaviGetWayPointsRequest); }; -} // namespace commands +} // namespace commands -} // namespace application_manager +} // namespace application_manager -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_GET_WAY_POINTS_REQUEST_H_ +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_GET_WAY_POINTS_REQUEST_H_ diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_get_way_points_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_get_way_points_response.h index 4a9b848adc..633d927715 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/navi_get_way_points_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_get_way_points_response.h @@ -42,32 +42,32 @@ namespace commands { /** * @brief NaviGetWaypoints command class **/ -class NaviGetWayPointsResponse - : public ResponseFromHMI { +class NaviGetWayPointsResponse : public ResponseFromHMI { public: - /** - * @brief NaviGetWaypoints class constructor - * - * @param message Incoming SmartObject message - **/ - NaviGetWayPointsResponse(const MessageSharedPtr& message, - ApplicationManager& application_manager); + /** + * @brief NaviGetWaypoints class constructor + * + * @param message Incoming SmartObject message + **/ + NaviGetWayPointsResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief NaviGetWaypoints class destructor - **/ - virtual ~NaviGetWayPointsResponse(); + /** + * @brief NaviGetWaypoints class destructor + **/ + virtual ~NaviGetWayPointsResponse(); + + /** + * @brief Execute command + **/ + virtual void Run() OVERRIDE; - /** - * @brief Execute command - **/ - virtual void Run() OVERRIDE; private: DISALLOW_COPY_AND_ASSIGN(NaviGetWayPointsResponse); }; -} // namespace commands +} // namespace commands -} // namespace application_manager +} // namespace application_manager -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_GET_WAY_POINTS_RESPONSE_H_ +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_GET_WAY_POINTS_RESPONSE_H_ diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_is_ready_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_is_ready_request.h index bfdb08c421..9f1adaeee0 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/navi_is_ready_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_is_ready_request.h @@ -49,7 +49,8 @@ class NaviIsReadyRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - NaviIsReadyRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + NaviIsReadyRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief NaviIsReadyRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_is_ready_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_is_ready_response.h index f962f51925..72c001b863 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/navi_is_ready_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_is_ready_response.h @@ -49,7 +49,8 @@ class NaviIsReadyResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - NaviIsReadyResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + NaviIsReadyResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief NaviIsReadyResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_send_location_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_send_location_request.h index af592c3ba4..56a9594c0b 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/navi_send_location_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_send_location_request.h @@ -49,7 +49,8 @@ class NaviSendLocationRequest : public RequestToHMI { * * @param message Incoming SmartObject message */ - NaviSendLocationRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + NaviSendLocationRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief NaviSendLocationRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_send_location_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_send_location_response.h index 92961f3311..ec3392642a 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/navi_send_location_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_send_location_response.h @@ -49,7 +49,8 @@ class NaviSendLocationResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message */ - NaviSendLocationResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + NaviSendLocationResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief NaviSendLocationResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_show_constant_tbt_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_show_constant_tbt_request.h index c5d23698c7..4cb8ddd7f7 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/navi_show_constant_tbt_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_show_constant_tbt_request.h @@ -49,7 +49,8 @@ class NaviShowConstantTBTRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - NaviShowConstantTBTRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + NaviShowConstantTBTRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief NaviShowConstantTBTRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_show_constant_tbt_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_show_constant_tbt_response.h index 35627ecc60..d9e7b1d234 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/navi_show_constant_tbt_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_show_constant_tbt_response.h @@ -49,7 +49,8 @@ class NaviShowConstantTBTResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - NaviShowConstantTBTResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + NaviShowConstantTBTResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief NaviShowConstantTBTResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_start_stream_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_start_stream_request.h index 813671b55c..6fcb3f3267 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/navi_start_stream_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_start_stream_request.h @@ -44,44 +44,44 @@ namespace commands { **/ class NaviStartStreamRequest : public RequestToHMI, public event_engine::EventObserver { - public: - /** - * @brief NaviStartStreamRequest class constructor - * - * @param message Incoming SmartObject message - **/ - NaviStartStreamRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); - - /** - * @brief OnNaviStartStreamRequest class destructor - **/ - virtual ~NaviStartStreamRequest(); - - /** - * @brief Execute command - **/ - virtual void Run(); + public: + /** + * @brief NaviStartStreamRequest class constructor + * + * @param message Incoming SmartObject message + **/ + NaviStartStreamRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief On event callback - **/ - virtual void on_event(const event_engine::Event& event); + /** + * @brief OnNaviStartStreamRequest class destructor + **/ + virtual ~NaviStartStreamRequest(); - /** - * @brief onTimeOut from requrst Controller - */ - virtual void onTimeOut(); + /** + * @brief Execute command + **/ + virtual void Run(); + /** + * @brief On event callback + **/ + virtual void on_event(const event_engine::Event& event); - /** - * @brief RetryStartSession resend HMI startSession request if needed. - * If limit expired, set video_stream_retry_number counter to 0 + /** + * @brief onTimeOut from requrst Controller */ - void RetryStartSession(); + virtual void onTimeOut(); + + /** + * @brief RetryStartSession resend HMI startSession request if needed. + * If limit expired, set video_stream_retry_number counter to 0 + */ + void RetryStartSession(); - private: - uint32_t retry_number_; - DISALLOW_COPY_AND_ASSIGN(NaviStartStreamRequest); + private: + uint32_t retry_number_; + DISALLOW_COPY_AND_ASSIGN(NaviStartStreamRequest); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_start_stream_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_start_stream_response.h index ac8179a6cc..3e18767194 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/navi_start_stream_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_start_stream_response.h @@ -48,7 +48,8 @@ class NaviStartStreamResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - NaviStartStreamResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + NaviStartStreamResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief NaviStartStreamResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_stop_stream_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_stop_stream_request.h index bb4ea5fc52..d6952d0305 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/navi_stop_stream_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_stop_stream_request.h @@ -48,7 +48,8 @@ class NaviStopStreamRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - NaviStopStreamRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + NaviStopStreamRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief NaviStopStreamRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_stop_stream_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_stop_stream_response.h index 8cadc19ef9..b3107b5e61 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/navi_stop_stream_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_stop_stream_response.h @@ -48,7 +48,8 @@ class NaviStopStreamResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - NaviStopStreamResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + NaviStopStreamResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnNaviStopStreamResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_subscribe_way_points_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_subscribe_way_points_request.h index 57bddf9c9d..33a2077918 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/navi_subscribe_way_points_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_subscribe_way_points_request.h @@ -42,31 +42,30 @@ namespace commands { /** * @brief NaviSubscribeWayPointsRequest command class **/ -class NaviSubscribeWayPointsRequest - : public RequestToHMI { -public: - /** - * @brief NaviSubscribeWayPointsRequest class constructor - * - * @param message Incoming SmartObject message - **/ - NaviSubscribeWayPointsRequest(const MessageSharedPtr& messag, - ApplicationManager& application_manager); - /** - * @brief NaviSubscribeWayPointsRequest class destructor - **/ - virtual ~NaviSubscribeWayPointsRequest(); - /** - * @brief Execute command - **/ - virtual void Run() OVERRIDE; +class NaviSubscribeWayPointsRequest : public RequestToHMI { + public: + /** + * @brief NaviSubscribeWayPointsRequest class constructor + * + * @param message Incoming SmartObject message + **/ + NaviSubscribeWayPointsRequest(const MessageSharedPtr& messag, + ApplicationManager& application_manager); + /** + * @brief NaviSubscribeWayPointsRequest class destructor + **/ + virtual ~NaviSubscribeWayPointsRequest(); + /** + * @brief Execute command + **/ + virtual void Run() OVERRIDE; -private: + private: DISALLOW_COPY_AND_ASSIGN(NaviSubscribeWayPointsRequest); }; -} // namespace commands +} // namespace commands -} // namespace application_manager +} // namespace application_manager -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SUBSCRIBE_WAY_POINTS_REQUEST_H_ +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SUBSCRIBE_WAY_POINTS_REQUEST_H_ diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_subscribe_way_points_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_subscribe_way_points_response.h index a60e9ce094..eff2b281f2 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/navi_subscribe_way_points_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_subscribe_way_points_response.h @@ -42,32 +42,32 @@ namespace commands { /** * @brief NaviSubscribeWaypoints command class **/ -class NaviSubscribeWayPointsResponse - : public ResponseFromHMI { +class NaviSubscribeWayPointsResponse : public ResponseFromHMI { public: - /** - * @brief NaviSubscribeWaypoints class constructor - * - * @param message Incoming SmartObject message - **/ - NaviSubscribeWayPointsResponse(const MessageSharedPtr& message, - ApplicationManager& application_manager); + /** + * @brief NaviSubscribeWaypoints class constructor + * + * @param message Incoming SmartObject message + **/ + NaviSubscribeWayPointsResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief NaviSubscribeWaypoints class destructor - **/ - virtual ~NaviSubscribeWayPointsResponse(); + /** + * @brief NaviSubscribeWaypoints class destructor + **/ + virtual ~NaviSubscribeWayPointsResponse(); + + /** + * @brief Execute command + **/ + virtual void Run() OVERRIDE; - /** - * @brief Execute command - **/ - virtual void Run() OVERRIDE; private: DISALLOW_COPY_AND_ASSIGN(NaviSubscribeWayPointsResponse); }; -} // namespace commands +} // namespace commands -} // namespace application_manager +} // namespace application_manager -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SUBSCRIBE_WAY_POINTS_RESPONSE_H_ +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_SUBSCRIBE_WAY_POINTS_RESPONSE_H_ diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_unsubscribe_way_points_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_unsubscribe_way_points_request.h index 6566a2a841..607bb1ef26 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/navi_unsubscribe_way_points_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_unsubscribe_way_points_request.h @@ -42,31 +42,30 @@ namespace commands { /** * @brief NaviSubscribeWayPointsRequest command class **/ -class NaviUnSubscribeWayPointsRequest - : public RequestToHMI { -public: - /** - * @brief NaviUnSubscribeWayPointsRequest class constructor - * - * @param message Incoming SmartObject message - **/ - NaviUnSubscribeWayPointsRequest(const MessageSharedPtr& message, - ApplicationManager& application_manager); - /** - * @brief NaviUnSubscribeWayPointsRequest class destructor - **/ - virtual ~NaviUnSubscribeWayPointsRequest(); - /** - * @brief Execute command - **/ - virtual void Run() OVERRIDE; +class NaviUnSubscribeWayPointsRequest : public RequestToHMI { + public: + /** + * @brief NaviUnSubscribeWayPointsRequest class constructor + * + * @param message Incoming SmartObject message + **/ + NaviUnSubscribeWayPointsRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); + /** + * @brief NaviUnSubscribeWayPointsRequest class destructor + **/ + virtual ~NaviUnSubscribeWayPointsRequest(); + /** + * @brief Execute command + **/ + virtual void Run() OVERRIDE; -private: + private: DISALLOW_COPY_AND_ASSIGN(NaviUnSubscribeWayPointsRequest); }; -} // namespace commands +} // namespace commands -} // namespace application_manager +} // namespace application_manager -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_ +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_ diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_unsubscribe_way_points_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_unsubscribe_way_points_response.h index 62d7900646..936814f2fe 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/navi_unsubscribe_way_points_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_unsubscribe_way_points_response.h @@ -42,31 +42,31 @@ namespace commands { /** * @brief NaviUnSubscribeWaypoints command class **/ -class NaviUnsubscribeWayPointsResponse - : public ResponseFromHMI { +class NaviUnsubscribeWayPointsResponse : public ResponseFromHMI { public: - /** - * @brief NaviUnSubscribeWaypoints class constructor - * - * @param message Incoming SmartObject message - **/ - NaviUnsubscribeWayPointsResponse(const MessageSharedPtr& message, - ApplicationManager& application_manager); + /** + * @brief NaviUnSubscribeWaypoints class constructor + * + * @param message Incoming SmartObject message + **/ + NaviUnsubscribeWayPointsResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief NaviUnSubscribeWaypoints class destructor - **/ - virtual ~NaviUnsubscribeWayPointsResponse(); + /** + * @brief NaviUnSubscribeWaypoints class destructor + **/ + virtual ~NaviUnsubscribeWayPointsResponse(); + + /** + * @brief Execute command + **/ + virtual void Run() OVERRIDE; - /** - * @brief Execute command - **/ - virtual void Run() OVERRIDE; private: DISALLOW_COPY_AND_ASSIGN(NaviUnsubscribeWayPointsResponse); }; -} // namespace commands +} // namespace commands -} // namespace application_manager -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_ +} // namespace application_manager +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_NAVI_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_ diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_update_turn_list_request.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_update_turn_list_request.h index 089ae024f2..830e9358ec 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/navi_update_turn_list_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_update_turn_list_request.h @@ -49,7 +49,8 @@ class NaviUpdateTurnListRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - NaviUpdateTurnListRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + NaviUpdateTurnListRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief NaviUpdateTurnListRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/navi_update_turn_list_response.h b/src/components/application_manager/include/application_manager/commands/hmi/navi_update_turn_list_response.h index 6ce5219206..93c714b4f4 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/navi_update_turn_list_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/navi_update_turn_list_response.h @@ -49,7 +49,8 @@ class NaviUpdateTurnListResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - NaviUpdateTurnListResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + NaviUpdateTurnListResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief NaviUpdateTurnListResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/notification_from_hmi.h b/src/components/application_manager/include/application_manager/commands/hmi/notification_from_hmi.h index 10d88b216d..c74108ccf0 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/notification_from_hmi.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/notification_from_hmi.h @@ -51,14 +51,15 @@ namespace smart_objects = NsSmartDeviceLink::NsSmartObjects; class NotificationFromHMI : public CommandImpl { public: NotificationFromHMI(const MessageSharedPtr& message, - ApplicationManager& application_manager); + ApplicationManager& application_manager); virtual ~NotificationFromHMI(); virtual bool Init(); virtual bool CleanUp(); virtual void Run(); void SendNotificationToMobile(const MessageSharedPtr& message); void CreateHMIRequest(const hmi_apis::FunctionID::eType& function_id, - const smart_objects::SmartObject& msg_params) const; + const smart_objects::SmartObject& msg_params) const; + private: DISALLOW_COPY_AND_ASSIGN(NotificationFromHMI); }; diff --git a/src/components/application_manager/include/application_manager/commands/hmi/notification_to_hmi.h b/src/components/application_manager/include/application_manager/commands/hmi/notification_to_hmi.h index d382cfcc83..dd2db8804a 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/notification_to_hmi.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/notification_to_hmi.h @@ -42,12 +42,13 @@ namespace commands { class NotificationToHMI : public CommandImpl { public: NotificationToHMI(const MessageSharedPtr& message, - ApplicationManager& application_manager); + ApplicationManager& application_manager); virtual ~NotificationToHMI(); virtual bool Init(); virtual bool CleanUp(); virtual void Run(); void SendNotification(); + private: DISALLOW_COPY_AND_ASSIGN(NotificationToHMI); }; diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_allow_sdl_functionality_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_allow_sdl_functionality_notification.h index acfc2f2bbf..ee7d22b859 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_allow_sdl_functionality_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_allow_sdl_functionality_notification.h @@ -43,26 +43,27 @@ namespace commands { * @brief OnAllowSDLFunctionalityNotification command class **/ class OnAllowSDLFunctionalityNotification : public NotificationFromHMI { - public: - /** - * @brief OnAllowSDLFunctionalityNotification class constructor - * - * @param message Incoming SmartObject message - **/ - OnAllowSDLFunctionalityNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + public: + /** + * @brief OnAllowSDLFunctionalityNotification class constructor + * + * @param message Incoming SmartObject message + **/ + OnAllowSDLFunctionalityNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief OnAllowSDLFunctionalityNotification class destructor - **/ - virtual ~OnAllowSDLFunctionalityNotification(); + /** + * @brief OnAllowSDLFunctionalityNotification class destructor + **/ + virtual ~OnAllowSDLFunctionalityNotification(); - /** - * @brief Execute command - **/ - virtual void Run(); + /** + * @brief Execute command + **/ + virtual void Run(); - private: - DISALLOW_COPY_AND_ASSIGN(OnAllowSDLFunctionalityNotification); + private: + DISALLOW_COPY_AND_ASSIGN(OnAllowSDLFunctionalityNotification); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_app_activated_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_app_activated_notification.h index 44b26e9abb..a1de12b4d6 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_app_activated_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_app_activated_notification.h @@ -43,26 +43,27 @@ namespace commands { * @brief OnAppActivatedNotification command class **/ class OnAppActivatedNotification : public NotificationFromHMI { - public: - /** - * @brief OnAppActivatedNotification class constructor - * - * @param message Incoming SmartObject message - **/ - OnAppActivatedNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + public: + /** + * @brief OnAppActivatedNotification class constructor + * + * @param message Incoming SmartObject message + **/ + OnAppActivatedNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief OnAppActivatedNotification class destructor - **/ - virtual ~OnAppActivatedNotification(); + /** + * @brief OnAppActivatedNotification class destructor + **/ + virtual ~OnAppActivatedNotification(); - /** - * @brief Execute command - **/ - virtual void Run(); + /** + * @brief Execute command + **/ + virtual void Run(); - private: - DISALLOW_COPY_AND_ASSIGN(OnAppActivatedNotification); + private: + DISALLOW_COPY_AND_ASSIGN(OnAppActivatedNotification); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_app_deactivated_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_app_deactivated_notification.h index a7e8150e7d..687d492a01 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_app_deactivated_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_app_deactivated_notification.h @@ -49,7 +49,8 @@ class OnAppDeactivatedNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnAppDeactivatedNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnAppDeactivatedNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnAppDeactivatedNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_app_permission_changed_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_app_permission_changed_notification.h index 3598b35850..bdaf6d1119 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_app_permission_changed_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_app_permission_changed_notification.h @@ -43,26 +43,27 @@ namespace commands { * @brief OnAppPermissionChangedNotification command class **/ class OnAppPermissionChangedNotification : public NotificationToHMI { - public: - /** - * @brief OnAppPermissionChangedNotification class constructor - * - * @param message Incoming SmartObject message - **/ - OnAppPermissionChangedNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + public: + /** + * @brief OnAppPermissionChangedNotification class constructor + * + * @param message Incoming SmartObject message + **/ + OnAppPermissionChangedNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief OnAppPermissionChangedNotification class destructor - **/ - virtual ~OnAppPermissionChangedNotification(); + /** + * @brief OnAppPermissionChangedNotification class destructor + **/ + virtual ~OnAppPermissionChangedNotification(); - /** - * @brief Execute command - **/ - virtual void Run(); + /** + * @brief Execute command + **/ + virtual void Run(); - private: - DISALLOW_COPY_AND_ASSIGN(OnAppPermissionChangedNotification); + private: + DISALLOW_COPY_AND_ASSIGN(OnAppPermissionChangedNotification); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_app_permission_consent_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_app_permission_consent_notification.h index a30b2c9a0d..5cafe0c1b5 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_app_permission_consent_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_app_permission_consent_notification.h @@ -43,26 +43,27 @@ namespace commands { * @brief OnAppPermissionConsentNotification command class **/ class OnAppPermissionConsentNotification : public NotificationFromHMI { - public: - /** - * @brief OnAppPermissionConsentNotification class constructor - * - * @param message Incoming SmartObject message - **/ - OnAppPermissionConsentNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + public: + /** + * @brief OnAppPermissionConsentNotification class constructor + * + * @param message Incoming SmartObject message + **/ + OnAppPermissionConsentNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief OnAppPermissionConsentNotification class destructor - **/ - virtual ~OnAppPermissionConsentNotification(); + /** + * @brief OnAppPermissionConsentNotification class destructor + **/ + virtual ~OnAppPermissionConsentNotification(); - /** - * @brief Execute command - **/ - virtual void Run(); + /** + * @brief Execute command + **/ + virtual void Run(); - private: - DISALLOW_COPY_AND_ASSIGN(OnAppPermissionConsentNotification); + private: + DISALLOW_COPY_AND_ASSIGN(OnAppPermissionConsentNotification); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_app_registered_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_app_registered_notification.h index edfdc208b9..58e92a977a 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_app_registered_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_app_registered_notification.h @@ -49,7 +49,8 @@ class OnAppRegisteredNotification : public NotificationToHMI { * * @param message Incoming SmartObject message **/ - OnAppRegisteredNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnAppRegisteredNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnAppRegisteredNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_app_unregistered_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_app_unregistered_notification.h index a8c87e84fa..980e558d6f 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_app_unregistered_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_app_unregistered_notification.h @@ -49,7 +49,8 @@ class OnAppUnregisteredNotification : public NotificationToHMI { * * @param message Incoming SmartObject message **/ - OnAppUnregisteredNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnAppUnregisteredNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnAppUnregisteredNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_audio_data_streaming_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_audio_data_streaming_notification.h index 6aa33a032a..121367ed90 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_audio_data_streaming_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_audio_data_streaming_notification.h @@ -43,26 +43,27 @@ namespace commands { * @brief OnAudioDataStreamingNotification command class **/ class OnAudioDataStreamingNotification : public NotificationToHMI { - public: - /** - * @brief OnAudioDataStreamingNotification class constructor - * - * @param message Incoming SmartObject message - **/ - OnAudioDataStreamingNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + public: + /** + * @brief OnAudioDataStreamingNotification class constructor + * + * @param message Incoming SmartObject message + **/ + OnAudioDataStreamingNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief OnAudioDataStreamingNotification class destructor - **/ - virtual ~OnAudioDataStreamingNotification(); + /** + * @brief OnAudioDataStreamingNotification class destructor + **/ + virtual ~OnAudioDataStreamingNotification(); - /** - * @brief Execute command - **/ - virtual void Run(); + /** + * @brief Execute command + **/ + virtual void Run(); - private: - DISALLOW_COPY_AND_ASSIGN(OnAudioDataStreamingNotification); + private: + DISALLOW_COPY_AND_ASSIGN(OnAudioDataStreamingNotification); }; } // namespace commands @@ -70,4 +71,3 @@ class OnAudioDataStreamingNotification : public NotificationToHMI { } // namespace application_manager #endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_AUDIO_DATA_STREAMING_NOTIFICATION_H_ - diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_button_event_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_button_event_notification.h index 92f5ac6449..f294bce2c8 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_button_event_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_button_event_notification.h @@ -53,7 +53,8 @@ class OnButtonEventNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnButtonEventNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnButtonEventNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief Execute command @@ -64,7 +65,7 @@ class OnButtonEventNotification : public NotificationFromHMI { DISALLOW_COPY_AND_ASSIGN(OnButtonEventNotification); }; -} // namespace hmi +} // namespace hmi } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_button_press_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_button_press_notification.h index c0499d80e2..8936ed8a0f 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_button_press_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_button_press_notification.h @@ -53,7 +53,8 @@ class OnButtonPressNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnButtonPressNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnButtonPressNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief Execute command diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_button_subscription_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_button_subscription_notification.h index 5b2b71f63b..d98ba3a90b 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_button_subscription_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_button_subscription_notification.h @@ -51,7 +51,8 @@ class OnButtonSubscriptionNotification : public NotificationToHMI { * * @param message Incoming SmartObject message **/ - OnButtonSubscriptionNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnButtonSubscriptionNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnButtonSubscriptionNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_device_chosen_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_device_chosen_notification.h index ad478d9938..5345135583 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_device_chosen_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_device_chosen_notification.h @@ -49,7 +49,8 @@ class OnDeviceChosenNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnDeviceChosenNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnDeviceChosenNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnDeviceChosenNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_device_state_changed_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_device_state_changed_notification.h index 2adb19459d..62a87f4599 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_device_state_changed_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_device_state_changed_notification.h @@ -43,26 +43,27 @@ namespace commands { * @brief OnDeviceStateChangedNotification command class **/ class OnDeviceStateChangedNotification : public NotificationFromHMI { - public: - /** - * @brief OnDeviceStateChangedNotification class constructor - * - * @param message Incoming SmartObject message - **/ - OnDeviceStateChangedNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + public: + /** + * @brief OnDeviceStateChangedNotification class constructor + * + * @param message Incoming SmartObject message + **/ + OnDeviceStateChangedNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief OnDeviceStateChangedNotification class destructor - **/ - virtual ~OnDeviceStateChangedNotification(); + /** + * @brief OnDeviceStateChangedNotification class destructor + **/ + virtual ~OnDeviceStateChangedNotification(); - /** - * @brief Execute command - **/ - virtual void Run(); + /** + * @brief Execute command + **/ + virtual void Run(); - private: - DISALLOW_COPY_AND_ASSIGN(OnDeviceStateChangedNotification); + private: + DISALLOW_COPY_AND_ASSIGN(OnDeviceStateChangedNotification); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_driver_distraction_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_driver_distraction_notification.h index d2b995c7ff..69d1707bf7 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_driver_distraction_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_driver_distraction_notification.h @@ -53,7 +53,8 @@ class OnDriverDistractionNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnDriverDistractionNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnDriverDistractionNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnDriverDistractionNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_event_changed_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_event_changed_notification.h index a6e29012ff..e066332d4c 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_event_changed_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_event_changed_notification.h @@ -43,26 +43,27 @@ namespace commands { * @brief OnEventChangedNotification command class **/ class OnEventChangedNotification : public NotificationFromHMI { - public: - /** - * @brief OnEventChangedNotification class constructor - * - * @param message Incoming SmartObject message - **/ - OnEventChangedNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + public: + /** + * @brief OnEventChangedNotification class constructor + * + * @param message Incoming SmartObject message + **/ + OnEventChangedNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief OnEventChangedNotification class destructor - **/ - virtual ~OnEventChangedNotification(); + /** + * @brief OnEventChangedNotification class destructor + **/ + virtual ~OnEventChangedNotification(); - /** - * @brief Execute command - **/ - virtual void Run(); + /** + * @brief Execute command + **/ + virtual void Run(); - private: - DISALLOW_COPY_AND_ASSIGN(OnEventChangedNotification); + private: + DISALLOW_COPY_AND_ASSIGN(OnEventChangedNotification); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_exit_all_applications_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_exit_all_applications_notification.h index 41abd30dcf..ad10a58bff 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_exit_all_applications_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_exit_all_applications_notification.h @@ -49,7 +49,8 @@ class OnExitAllApplicationsNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnExitAllApplicationsNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnExitAllApplicationsNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnExitAllApplicationsNotification class destructor @@ -62,7 +63,6 @@ class OnExitAllApplicationsNotification : public NotificationFromHMI { virtual void Run(); private: - /** * @brief Notify's HMI that SDL stored all data required for resumption **/ diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_exit_application_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_exit_application_notification.h index 2e8a9bc6d4..275b266b98 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_exit_application_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_exit_application_notification.h @@ -49,7 +49,8 @@ class OnExitApplicationNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnExitApplicationNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnExitApplicationNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnExitApplicationNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_file_removed_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_file_removed_notification.h index 1382760a3c..3f1ac17fc4 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_file_removed_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_file_removed_notification.h @@ -49,7 +49,8 @@ class OnFileRemovedNotification : public NotificationToHMI { * * @param message Incoming SmartObject message **/ - OnFileRemovedNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnFileRemovedNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnFileRemovedNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_find_applications.h b/src/components/application_manager/include/application_manager/commands/hmi/on_find_applications.h index 6840122746..32db73c2f5 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_find_applications.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_find_applications.h @@ -49,7 +49,8 @@ class OnFindApplications : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnFindApplications(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnFindApplications(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnFindApplications class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_ignition_cycle_over_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_ignition_cycle_over_notification.h index a747238f29..acb1ff31ac 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_ignition_cycle_over_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_ignition_cycle_over_notification.h @@ -50,7 +50,8 @@ class OnIgnitionCycleOverNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnIgnitionCycleOverNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnIgnitionCycleOverNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnIgnitionCycleOverNotification class destructor @@ -63,7 +64,6 @@ class OnIgnitionCycleOverNotification : public NotificationFromHMI { virtual void Run(); private: - DISALLOW_COPY_AND_ASSIGN(OnIgnitionCycleOverNotification); }; diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_navi_tbt_client_state_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_navi_tbt_client_state_notification.h index ab7ac2e5eb..0150853546 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_navi_tbt_client_state_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_navi_tbt_client_state_notification.h @@ -50,7 +50,8 @@ class OnNaviTBTClientStateNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnNaviTBTClientStateNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnNaviTBTClientStateNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnNaviTBTClientStateNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_navi_way_point_change_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_navi_way_point_change_notification.h index ecac3e6375..d304685008 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_navi_way_point_change_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_navi_way_point_change_notification.h @@ -51,7 +51,7 @@ class OnNaviWayPointChangeNotification : public NotificationFromHMI { * @param message Incoming SmartObject message **/ OnNaviWayPointChangeNotification(const MessageSharedPtr& message, - ApplicationManager& app_man); + ApplicationManager& app_man); /** * @brief OnNaviWayPointChangeNotification class destructor @@ -70,4 +70,4 @@ class OnNaviWayPointChangeNotification : public NotificationFromHMI { } // namespace commands } // namespace application_manager -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_NAVI_WAY_POINT_CHANGE_NOTIFICATION_H_ +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_NAVI_WAY_POINT_CHANGE_NOTIFICATION_H_ diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_policy_update.h b/src/components/application_manager/include/application_manager/commands/hmi/on_policy_update.h index e85c797f72..d4380048ee 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_policy_update.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_policy_update.h @@ -39,26 +39,27 @@ namespace application_manager { namespace commands { class OnPolicyUpdate : public NotificationFromHMI { - public: - /** - * @brief OnPolicyUpdate class constructor - * - * @param message Incoming SmartObject message - **/ - OnPolicyUpdate(const MessageSharedPtr& message, ApplicationManager& application_manager); + public: + /** + * @brief OnPolicyUpdate class constructor + * + * @param message Incoming SmartObject message + **/ + OnPolicyUpdate(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief OnPolicyUpdate class destructor - **/ - virtual ~OnPolicyUpdate(); + /** + * @brief OnPolicyUpdate class destructor + **/ + virtual ~OnPolicyUpdate(); - /** - * @brief Execute command - **/ - virtual void Run(); + /** + * @brief Execute command + **/ + virtual void Run(); - private: - DISALLOW_COPY_AND_ASSIGN(OnPolicyUpdate); + private: + DISALLOW_COPY_AND_ASSIGN(OnPolicyUpdate); }; } // namespace commands } // namespace application_manager diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_put_file_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_put_file_notification.h index 6357086bb7..809623fda0 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_put_file_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_put_file_notification.h @@ -50,7 +50,8 @@ class OnPutFileNotification : public NotificationToHMI { * * @param message Incoming SmartObject message **/ - OnPutFileNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnPutFileNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnPutFileNotification class destructor @@ -63,7 +64,6 @@ class OnPutFileNotification : public NotificationToHMI { virtual void Run(); private: - DISALLOW_COPY_AND_ASSIGN(OnPutFileNotification); }; diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_ready_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_ready_notification.h index 3ed938747a..7df1bf5ac0 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_ready_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_ready_notification.h @@ -50,7 +50,8 @@ class OnReadyNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnReadyNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnReadyNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnReadyNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_received_policy_update.h b/src/components/application_manager/include/application_manager/commands/hmi/on_received_policy_update.h index 603b60290e..0569e818d1 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_received_policy_update.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_received_policy_update.h @@ -40,26 +40,27 @@ namespace application_manager { namespace commands { class OnReceivedPolicyUpdate : public NotificationFromHMI { - public: - /** - * @brief OnReceivedPolicyUpdate class constructor - * - * @param message Incoming SmartObject message - **/ - OnReceivedPolicyUpdate(const MessageSharedPtr& message, ApplicationManager& application_manager); - - /** - * @brief OnReceivedPolicyUpdate class destructor + public: + /** + * @brief OnReceivedPolicyUpdate class constructor + * + * @param message Incoming SmartObject message **/ - virtual ~OnReceivedPolicyUpdate(); + OnReceivedPolicyUpdate(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief Execute command - **/ - virtual void Run(); + /** + * @brief OnReceivedPolicyUpdate class destructor + **/ + virtual ~OnReceivedPolicyUpdate(); + + /** + * @brief Execute command + **/ + virtual void Run(); - private: - DISALLOW_COPY_AND_ASSIGN(OnReceivedPolicyUpdate); + private: + DISALLOW_COPY_AND_ASSIGN(OnReceivedPolicyUpdate); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_record_start_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_record_start_notification.h index 881c254d2e..fbb8a0522a 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_record_start_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_record_start_notification.h @@ -49,7 +49,8 @@ class OnRecordStartdNotification : public NotificationToHMI { * * @param message Incoming SmartObject message **/ - OnRecordStartdNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnRecordStartdNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnRecordStartdNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_resume_audio_source_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_resume_audio_source_notification.h index 8f37b2bfc2..764ee6d180 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_resume_audio_source_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_resume_audio_source_notification.h @@ -50,7 +50,8 @@ class OnResumeAudioSourceNotification : public NotificationToHMI { * * @param message Incoming SmartObject message **/ - OnResumeAudioSourceNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnResumeAudioSourceNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnResumeAudioSourceNotification class destructor @@ -63,7 +64,6 @@ class OnResumeAudioSourceNotification : public NotificationToHMI { virtual void Run(); private: - DISALLOW_COPY_AND_ASSIGN(OnResumeAudioSourceNotification); }; diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_close_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_close_notification.h index f2547471dd..ef1d289ca7 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_close_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_close_notification.h @@ -49,7 +49,8 @@ class OnSDLCloseNotification : public NotificationToHMI { * * @param message Incoming SmartObject message **/ - OnSDLCloseNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnSDLCloseNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnSdlCloseNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_consent_needed_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_consent_needed_notification.h index 52f8208d4c..e54daab96f 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_consent_needed_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_consent_needed_notification.h @@ -43,26 +43,27 @@ namespace commands { * @brief OnSDLConsentNeededNotification command class **/ class OnSDLConsentNeededNotification : public NotificationToHMI { - public: - /** - * @brief OnSDLConsentNeededNotification class constructor - * - * @param message Incoming SmartObject message - **/ - OnSDLConsentNeededNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + public: + /** + * @brief OnSDLConsentNeededNotification class constructor + * + * @param message Incoming SmartObject message + **/ + OnSDLConsentNeededNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief OnSDLConsentNeededNotification class destructor - **/ - virtual ~OnSDLConsentNeededNotification(); + /** + * @brief OnSDLConsentNeededNotification class destructor + **/ + virtual ~OnSDLConsentNeededNotification(); - /** - * @brief Execute command - **/ - virtual void Run(); + /** + * @brief Execute command + **/ + virtual void Run(); - private: - DISALLOW_COPY_AND_ASSIGN(OnSDLConsentNeededNotification); + private: + DISALLOW_COPY_AND_ASSIGN(OnSDLConsentNeededNotification); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_persistence_complete_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_persistence_complete_notification.h index 28fed71793..6ac04b488b 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_persistence_complete_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_sdl_persistence_complete_notification.h @@ -43,26 +43,27 @@ namespace commands { * @brief OnSDLPersistenceCompleteNotification command class **/ class OnSDLPersistenceCompleteNotification : public NotificationToHMI { - public: - /** - * @brief OnSDLPersistenceCompleteNotification class constructor - * - * @param message Incoming SmartObject message - **/ - OnSDLPersistenceCompleteNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + public: + /** + * @brief OnSDLPersistenceCompleteNotification class constructor + * + * @param message Incoming SmartObject message + **/ + OnSDLPersistenceCompleteNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief OnSDLPersistenceCompleteNotification class destructor - **/ - virtual ~OnSDLPersistenceCompleteNotification(); + /** + * @brief OnSDLPersistenceCompleteNotification class destructor + **/ + virtual ~OnSDLPersistenceCompleteNotification(); - /** - * @brief Execute command - **/ - virtual void Run(); + /** + * @brief Execute command + **/ + virtual void Run(); - private: - DISALLOW_COPY_AND_ASSIGN(OnSDLPersistenceCompleteNotification); + private: + DISALLOW_COPY_AND_ASSIGN(OnSDLPersistenceCompleteNotification); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_start_device_discovery.h b/src/components/application_manager/include/application_manager/commands/hmi/on_start_device_discovery.h index fa405fbb11..dc40c1a614 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_start_device_discovery.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_start_device_discovery.h @@ -49,7 +49,8 @@ class OnStartDeviceDiscovery : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnStartDeviceDiscovery(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnStartDeviceDiscovery(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnStartDeviceDiscovery class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_status_update_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_status_update_notification.h index 02422ef3f5..62ee38c473 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_status_update_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_status_update_notification.h @@ -43,26 +43,27 @@ namespace commands { * @brief OnGetStatusUpdateNotification command class **/ class OnStatusUpdateNotification : public NotificationToHMI { - public: - /** - * @brief OnGetStatusUpdateNotification class constructor - * - * @param message Incoming SmartObject message - **/ - OnStatusUpdateNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + public: + /** + * @brief OnGetStatusUpdateNotification class constructor + * + * @param message Incoming SmartObject message + **/ + OnStatusUpdateNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief OnGetStatusUpdateNotification class destructor - **/ - virtual ~OnStatusUpdateNotification(); + /** + * @brief OnGetStatusUpdateNotification class destructor + **/ + virtual ~OnStatusUpdateNotification(); - /** - * @brief Execute command - **/ - virtual void Run(); + /** + * @brief Execute command + **/ + virtual void Run(); - private: - DISALLOW_COPY_AND_ASSIGN(OnStatusUpdateNotification); + private: + DISALLOW_COPY_AND_ASSIGN(OnStatusUpdateNotification); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_system_context_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_system_context_notification.h index 9610a31fee..9008a20cc9 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_system_context_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_system_context_notification.h @@ -51,7 +51,8 @@ class OnSystemContextNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnSystemContextNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnSystemContextNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnSystemContextNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_system_error_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_system_error_notification.h index 6c18c920e1..1e65b15c20 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_system_error_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_system_error_notification.h @@ -49,7 +49,8 @@ class OnSystemErrorNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnSystemErrorNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnSystemErrorNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnSystemErrorNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_system_info_changed_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_system_info_changed_notification.h index 66924ab8da..d709a5267c 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_system_info_changed_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_system_info_changed_notification.h @@ -43,26 +43,27 @@ namespace commands { * @brief OnSystemInfoChangedNotification command class **/ class OnSystemInfoChangedNotification : public NotificationFromHMI { - public: - /** - * @brief OnSystemInfoChangedNotification class constructor - * - * @param message Incoming SmartObject message - **/ - OnSystemInfoChangedNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + public: + /** + * @brief OnSystemInfoChangedNotification class constructor + * + * @param message Incoming SmartObject message + **/ + OnSystemInfoChangedNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief OnSystemInfoChangedNotification class destructor - **/ - virtual ~OnSystemInfoChangedNotification(); + /** + * @brief OnSystemInfoChangedNotification class destructor + **/ + virtual ~OnSystemInfoChangedNotification(); - /** - * @brief Execute command - **/ - virtual void Run(); + /** + * @brief Execute command + **/ + virtual void Run(); - private: - DISALLOW_COPY_AND_ASSIGN(OnSystemInfoChangedNotification); + private: + DISALLOW_COPY_AND_ASSIGN(OnSystemInfoChangedNotification); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_system_request_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_system_request_notification.h index 8ba8eee00a..8e4db24822 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_system_request_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_system_request_notification.h @@ -50,7 +50,8 @@ class OnSystemRequestNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnSystemRequestNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnSystemRequestNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnSystemRequestNotification class destructor @@ -63,7 +64,6 @@ class OnSystemRequestNotification : public NotificationFromHMI { virtual void Run(); private: - DISALLOW_COPY_AND_ASSIGN(OnSystemRequestNotification); }; diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_tts_language_change_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_tts_language_change_notification.h index 5bcdc419cf..245dc32386 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_tts_language_change_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_tts_language_change_notification.h @@ -49,7 +49,8 @@ class OnTTSLanguageChangeNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnTTSLanguageChangeNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnTTSLanguageChangeNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnTTSLanguageChangeNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_tts_reset_timeout_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_tts_reset_timeout_notification.h index d1e0b164b1..be84a93215 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_tts_reset_timeout_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_tts_reset_timeout_notification.h @@ -51,7 +51,8 @@ class OnTTSResetTimeoutNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnTTSResetTimeoutNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnTTSResetTimeoutNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnTTSResetTimeoutNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_tts_started_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_tts_started_notification.h index 280371c32f..234d8036eb 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_tts_started_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_tts_started_notification.h @@ -49,7 +49,8 @@ class OnTTSStartedNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnTTSStartedNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnTTSStartedNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnTTSStartedNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_tts_stopped_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_tts_stopped_notification.h index 537dbe22bb..4e058fde64 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_tts_stopped_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_tts_stopped_notification.h @@ -49,7 +49,8 @@ class OnTTSStoppedNotification : public NotificationFromHMI { * * @param message Incoming SmartObject OnTTSStartedNotificationmessage **/ - OnTTSStoppedNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnTTSStoppedNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnTTSStoppedNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_ui_command_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_ui_command_notification.h index b222b8d159..618bc13017 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_ui_command_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_ui_command_notification.h @@ -49,7 +49,8 @@ class OnUICommandNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnUICommandNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnUICommandNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnUICommandNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_ui_keyboard_input_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_ui_keyboard_input_notification.h index f7926198d1..6e881dc94a 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_ui_keyboard_input_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_ui_keyboard_input_notification.h @@ -52,7 +52,8 @@ class OnUIKeyBoardInputNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnUIKeyBoardInputNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnUIKeyBoardInputNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnUIKeyBoardInputNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_ui_language_change_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_ui_language_change_notification.h index a7d12d6303..cc8cd1eb0e 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_ui_language_change_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_ui_language_change_notification.h @@ -49,7 +49,8 @@ class OnUILanguageChangeNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnUILanguageChangeNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnUILanguageChangeNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnUILanguageChangeNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_ui_reset_timeout_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_ui_reset_timeout_notification.h index 5413512660..f5dd173998 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_ui_reset_timeout_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_ui_reset_timeout_notification.h @@ -51,7 +51,8 @@ class OnUIResetTimeoutNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnUIResetTimeoutNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnUIResetTimeoutNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnUIResetTimeoutNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_ui_touch_event_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_ui_touch_event_notification.h index c9e166d974..9e9384fffe 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_ui_touch_event_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_ui_touch_event_notification.h @@ -52,7 +52,8 @@ class OnUITouchEventNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnUITouchEventNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnUITouchEventNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnUITouchEventNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_update_device_list.h b/src/components/application_manager/include/application_manager/commands/hmi/on_update_device_list.h index 4c5eb00a1d..ee53445606 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_update_device_list.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_update_device_list.h @@ -49,7 +49,8 @@ class OnUpdateDeviceList : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnUpdateDeviceList(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnUpdateDeviceList(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnUpdateDeviceList class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h index f01b09dae6..9c5a8cd955 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_acc_pedal_position_notification.h @@ -50,7 +50,8 @@ class OnVIAccPedalPositionNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnVIAccPedalPositionNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnVIAccPedalPositionNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnVIAccPedalPositionNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_belt_status_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_belt_status_notification.h index 03cd64688d..c4f92269bb 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_belt_status_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_belt_status_notification.h @@ -50,7 +50,8 @@ class OnVIBeltStatusNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnVIBeltStatusNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnVIBeltStatusNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnVIBeltStatusNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_body_information_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_body_information_notification.h index 2f1a36325a..9d9854c50b 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_body_information_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_body_information_notification.h @@ -50,7 +50,8 @@ class OnVIBodyInformationNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnVIBodyInformationNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnVIBodyInformationNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnVIBodyInformationNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_device_status_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_device_status_notification.h index 7e0dda0fcd..c31ee1f209 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_device_status_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_device_status_notification.h @@ -50,7 +50,8 @@ class OnVIDeviceStatusNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnVIDeviceStatusNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnVIDeviceStatusNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnVIDeviceStatusNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_driver_braking_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_driver_braking_notification.h index a3e44140fc..108f02b5a4 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_driver_braking_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_driver_braking_notification.h @@ -50,7 +50,8 @@ class OnVIDriverBrakingNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnVIDriverBrakingNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnVIDriverBrakingNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnVIDriverBrakingNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_engine_torque_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_engine_torque_notification.h index c8f26678d9..bbd13963aa 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_engine_torque_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_engine_torque_notification.h @@ -50,7 +50,8 @@ class OnVIEngineTorqueNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnVIEngineTorqueNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnVIEngineTorqueNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnVIEngineTorqueNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_external_temperature_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_external_temperature_notification.h index 5c5adbede7..b996febacf 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_external_temperature_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_external_temperature_notification.h @@ -50,7 +50,8 @@ class OnVIExternalTemperatureNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnVIExternalTemperatureNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnVIExternalTemperatureNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnVIExternalTemperatureNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_notification.h index 6bd9153131..9c30b6c32c 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_notification.h @@ -50,7 +50,8 @@ class OnVIFuelLevelNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnVIFuelLevelNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnVIFuelLevelNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnVIFuelLevelNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_state_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_state_notification.h index e511e9ed2f..53b6ea209f 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_state_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_fuel_level_state_notification.h @@ -50,7 +50,8 @@ class OnVIFuelLevelStateNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnVIFuelLevelStateNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnVIFuelLevelStateNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnVIFuelLevelStateNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_gps_data_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_gps_data_notification.h index b3c12ca349..579344b538 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_gps_data_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_gps_data_notification.h @@ -50,7 +50,8 @@ class OnVIGpsDataNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnVIGpsDataNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnVIGpsDataNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnVIGpsDataNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_head_lamp_status_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_head_lamp_status_notification.h index 52230a9523..5fd3be85a4 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_head_lamp_status_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_head_lamp_status_notification.h @@ -50,7 +50,8 @@ class OnVIHeadLampStatusNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnVIHeadLampStatusNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnVIHeadLampStatusNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnVIHeadLampStatusNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h index 6035dfc2c3..ee82b1397f 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_instant_fuel_consumption_notification.h @@ -50,7 +50,8 @@ class OnVIInstantFuelConsumptionNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnVIInstantFuelConsumptionNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnVIInstantFuelConsumptionNotification( + const MessageSharedPtr& message, ApplicationManager& application_manager); /** * @brief OnVIInstantFuelConsumptionNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_my_key_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_my_key_notification.h index dca83b004c..364e42081c 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_my_key_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_my_key_notification.h @@ -50,7 +50,8 @@ class OnVIMyKeyNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnVIMyKeyNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnVIMyKeyNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnVIMyKeyNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_odometer_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_odometer_notification.h index ff179776de..7d93530f04 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_odometer_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_odometer_notification.h @@ -50,7 +50,8 @@ class OnVIOdometerNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnVIOdometerNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnVIOdometerNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnVIOdometerNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_prndl_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_prndl_notification.h index eff04a6f14..c09220d2a6 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_prndl_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_prndl_notification.h @@ -50,7 +50,8 @@ class OnVIPrndlNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnVIPrndlNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnVIPrndlNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnVIPrndlNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_rpm_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_rpm_notification.h index fae86d91ad..d05e1221df 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_rpm_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_rpm_notification.h @@ -50,7 +50,8 @@ class OnVIRpmNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnVIRpmNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnVIRpmNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnVIRpmNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_speed_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_speed_notification.h index fd01061bce..b1908cde28 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_speed_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_speed_notification.h @@ -50,7 +50,8 @@ class OnVISpeedNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnVISpeedNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnVISpeedNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnVISpeedNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h index 5ea75f9467..28f78ac4d5 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_steering_wheel_angle_notification.h @@ -50,7 +50,8 @@ class OnVISteeringWheelAngleNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnVISteeringWheelAngleNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnVISteeringWheelAngleNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnVISteeringWheelAngleNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_tire_pressure_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_tire_pressure_notification.h index f371ed61ba..eef4f0e4a4 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_tire_pressure_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_tire_pressure_notification.h @@ -50,7 +50,8 @@ class OnVITirePressureNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnVITirePressureNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnVITirePressureNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnVITirePressureNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_vehicle_data_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_vehicle_data_notification.h index bf406d346f..2422c47813 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_vehicle_data_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_vehicle_data_notification.h @@ -51,7 +51,8 @@ class OnVIVehicleDataNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnVIVehicleDataNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnVIVehicleDataNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnVIVehicleDataNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_vin_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_vin_notification.h index 9b22f95167..4ea04fbb0d 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_vin_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_vin_notification.h @@ -50,7 +50,8 @@ class OnVIVinNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnVIVinNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnVIVinNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnVIVinNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_wiper_status_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_wiper_status_notification.h index 08e279f6b7..2b57ef1dd3 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vi_wiper_status_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vi_wiper_status_notification.h @@ -50,7 +50,8 @@ class OnVIWiperStatusNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnVIWiperStatusNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnVIWiperStatusNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnVIWiperStatusNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_video_data_streaming_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_video_data_streaming_notification.h index b5cf7a7757..02c65df4e9 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_video_data_streaming_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_video_data_streaming_notification.h @@ -43,26 +43,27 @@ namespace commands { * @brief OnVideoDataStreamingNotification command class **/ class OnVideoDataStreamingNotification : public NotificationToHMI { - public: - /** - * @brief OnVideoDataStreamingNotification class constructor - * - * @param message Incoming SmartObject message - **/ - OnVideoDataStreamingNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + public: + /** + * @brief OnVideoDataStreamingNotification class constructor + * + * @param message Incoming SmartObject message + **/ + OnVideoDataStreamingNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief OnVideoDataStreamingNotification class destructor - **/ - virtual ~OnVideoDataStreamingNotification(); + /** + * @brief OnVideoDataStreamingNotification class destructor + **/ + virtual ~OnVideoDataStreamingNotification(); - /** - * @brief Execute command - **/ - virtual void Run(); + /** + * @brief Execute command + **/ + virtual void Run(); - private: - DISALLOW_COPY_AND_ASSIGN(OnVideoDataStreamingNotification); + private: + DISALLOW_COPY_AND_ASSIGN(OnVideoDataStreamingNotification); }; } // namespace commands @@ -70,4 +71,3 @@ class OnVideoDataStreamingNotification : public NotificationToHMI { } // namespace application_manager #endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_ON_VIDEO_DATA_STREAMING_NOTIFICATION_H_ - diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vr_command_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vr_command_notification.h index 709d13a7cc..fa85ba8468 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vr_command_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vr_command_notification.h @@ -50,7 +50,8 @@ class OnVRCommandNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnVRCommandNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnVRCommandNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnVRCommandNotification class destructor @@ -63,7 +64,6 @@ class OnVRCommandNotification : public NotificationFromHMI { virtual void Run(); private: - DISALLOW_COPY_AND_ASSIGN(OnVRCommandNotification); }; diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vr_language_change_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vr_language_change_notification.h index e078a8fa7e..d0f86e5f83 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vr_language_change_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vr_language_change_notification.h @@ -49,7 +49,8 @@ class OnVRLanguageChangeNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnVRLanguageChangeNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnVRLanguageChangeNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnVRLanguageChangeNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vr_started_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vr_started_notification.h index 6d5fa93e17..f142fcc25c 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vr_started_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vr_started_notification.h @@ -49,7 +49,8 @@ class OnVRStartedNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnVRStartedNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnVRStartedNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnVRStartedNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/on_vr_stopped_notification.h b/src/components/application_manager/include/application_manager/commands/hmi/on_vr_stopped_notification.h index 956156e964..d1dbcc91cd 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/on_vr_stopped_notification.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/on_vr_stopped_notification.h @@ -49,7 +49,8 @@ class OnVRStoppedNotification : public NotificationFromHMI { * * @param message Incoming SmartObject message **/ - OnVRStoppedNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnVRStoppedNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnVRStoppedNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/request_from_hmi.h b/src/components/application_manager/include/application_manager/commands/hmi/request_from_hmi.h index bd60941a3e..c435c41c47 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/request_from_hmi.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/request_from_hmi.h @@ -1,81 +1,82 @@ - /* - 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. +/* + 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. + */ + +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_REQUEST_FROM_HMI_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_REQUEST_FROM_HMI_H_ + +#include "application_manager/commands/command_impl.h" +#include "interfaces/HMI_API.h" + +namespace NsSmartDeviceLink { +namespace NsSmartObjects { +class SmartObject; +} +} + +namespace application_manager { + +namespace commands { + +namespace NsSmart = NsSmartDeviceLink::NsSmartObjects; + +class RequestFromHMI : public CommandImpl, public event_engine::EventObserver { + public: + RequestFromHMI(const MessageSharedPtr& message, + ApplicationManager& application_manager); + virtual ~RequestFromHMI(); + virtual bool Init(); + virtual bool CleanUp(); + virtual void Run(); + virtual void on_event(const event_engine::Event& event); + /** + * @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. */ + 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 FillCommonParametersOfSO(smart_objects::SmartObject* message, + uint32_t correlation_id, + hmi_apis::FunctionID::eType function_id); + + private: + DISALLOW_COPY_AND_ASSIGN(RequestFromHMI); +}; + +} // namespace commands +} // namespace application_manager - #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_REQUEST_FROM_HMI_H_ - #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_REQUEST_FROM_HMI_H_ - - #include "application_manager/commands/command_impl.h" - #include "interfaces/HMI_API.h" - - namespace NsSmartDeviceLink { - namespace NsSmartObjects { - class SmartObject; - } - } - - namespace application_manager { - - namespace commands { - - namespace NsSmart = NsSmartDeviceLink::NsSmartObjects; - - class RequestFromHMI : public CommandImpl, public event_engine::EventObserver { - public: - RequestFromHMI(const MessageSharedPtr& message, - ApplicationManager& application_manager); - virtual ~RequestFromHMI(); - virtual bool Init(); - virtual bool CleanUp(); - virtual void Run(); - virtual void on_event(const event_engine::Event& event); - /** - * @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. - */ - 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 FillCommonParametersOfSO(smart_objects::SmartObject* message, - uint32_t correlation_id, - hmi_apis::FunctionID::eType function_id); - private: - DISALLOW_COPY_AND_ASSIGN(RequestFromHMI); - }; - - } // namespace commands - } // namespace application_manager - - #endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_REQUEST_FROM_HMI_H_ +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_REQUEST_FROM_HMI_H_ diff --git a/src/components/application_manager/include/application_manager/commands/hmi/request_to_hmi.h b/src/components/application_manager/include/application_manager/commands/hmi/request_to_hmi.h index 55d49cbbd6..e512279e79 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/request_to_hmi.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/request_to_hmi.h @@ -40,11 +40,10 @@ namespace application_manager { namespace commands { - class RequestToHMI : public CommandImpl { public: RequestToHMI(const MessageSharedPtr& message, - ApplicationManager& application_manager); + ApplicationManager& application_manager); virtual ~RequestToHMI(); virtual bool Init(); virtual bool CleanUp(); diff --git a/src/components/application_manager/include/application_manager/commands/hmi/response_from_hmi.h b/src/components/application_manager/include/application_manager/commands/hmi/response_from_hmi.h index a7d2d3551d..a5d41252f5 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/response_from_hmi.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/response_from_hmi.h @@ -52,12 +52,13 @@ namespace smart_objects = NsSmartDeviceLink::NsSmartObjects; class ResponseFromHMI : public CommandImpl { public: ResponseFromHMI(const MessageSharedPtr& message, - ApplicationManager& application_manager); + ApplicationManager& application_manager); virtual ~ResponseFromHMI(); virtual bool Init(); virtual bool CleanUp(); virtual void Run(); - void SendResponseToMobile(const MessageSharedPtr& message, ApplicationManager& application_manager); + void SendResponseToMobile(const MessageSharedPtr& message, + ApplicationManager& application_manager); /* * @brief Creates HMI request diff --git a/src/components/application_manager/include/application_manager/commands/hmi/response_to_hmi.h b/src/components/application_manager/include/application_manager/commands/hmi/response_to_hmi.h index 665e6b74e6..f00e57ff3a 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/response_to_hmi.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/response_to_hmi.h @@ -52,7 +52,7 @@ namespace NsSmart = NsSmartDeviceLink::NsSmartObjects; class ResponseToHMI : public CommandImpl { public: ResponseToHMI(const MessageSharedPtr& message, - ApplicationManager& application_manager); + ApplicationManager& application_manager); virtual ~ResponseToHMI(); virtual bool Init(); virtual bool CleanUp(); diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_activate_app_request.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_activate_app_request.h index 16f1fa9284..ce86ea2df3 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/sdl_activate_app_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/sdl_activate_app_request.h @@ -40,48 +40,51 @@ namespace application_manager { namespace commands { - typedef std::pair<ApplicationSharedPtr, std::vector<ApplicationSharedPtr> > DevicesApps; +typedef std::pair<ApplicationSharedPtr, std::vector<ApplicationSharedPtr> > + DevicesApps; /** * @brief SDLActivateAppRequest command class **/ class SDLActivateAppRequest : public RequestFromHMI { - public: - /** - * @brief SDLActivateAppRequest class constructor - * - * @param message Incoming SmartObject message - **/ - SDLActivateAppRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + public: + /** + * @brief SDLActivateAppRequest class constructor + * + * @param message Incoming SmartObject message + **/ + SDLActivateAppRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief SDLActivateAppRequest class destructor - **/ - virtual ~SDLActivateAppRequest(); + /** + * @brief SDLActivateAppRequest class destructor + **/ + virtual ~SDLActivateAppRequest(); - /** - * @brief Execute command - **/ - virtual void Run(); + /** + * @brief Execute command + **/ + virtual void Run(); - /** - * @brief onTimeOut allows to process case when timeout has appeared - * during request execution. - */ - virtual void onTimeOut(); + /** + * @brief onTimeOut allows to process case when timeout has appeared + * during request execution. + */ + virtual void onTimeOut(); - /** - * @brief on_event allows to handle events - * - * @param event event type that current request subscribed on. - */ - virtual void on_event(const event_engine::Event& event); - private: - uint32_t app_id() const; - uint32_t hmi_app_id(const smart_objects::SmartObject& so) const; + /** + * @brief on_event allows to handle events + * + * @param event event type that current request subscribed on. + */ + virtual void on_event(const event_engine::Event& event); - DevicesApps FindAllAppOnParticularDevice( - const connection_handler::DeviceHandle handle); - DISALLOW_COPY_AND_ASSIGN(SDLActivateAppRequest); + private: + uint32_t app_id() const; + uint32_t hmi_app_id(const smart_objects::SmartObject& so) const; + + DevicesApps FindAllAppOnParticularDevice( + const connection_handler::DeviceHandle handle); + DISALLOW_COPY_AND_ASSIGN(SDLActivateAppRequest); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_activate_app_response.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_activate_app_response.h index 62c9fc0843..f35a295581 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/sdl_activate_app_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/sdl_activate_app_response.h @@ -43,26 +43,27 @@ namespace commands { * @brief SDLActivateAppResponse command class **/ class SDLActivateAppResponse : public ResponseToHMI { - public: - /** - * @brief SDLActivateAppResponse class constructor - * - * @param message Incoming SmartObject message - **/ - SDLActivateAppResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + public: + /** + * @brief SDLActivateAppResponse class constructor + * + * @param message Incoming SmartObject message + **/ + SDLActivateAppResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief SDLActivateAppResponse class destructor - **/ - virtual ~SDLActivateAppResponse(); + /** + * @brief SDLActivateAppResponse class destructor + **/ + virtual ~SDLActivateAppResponse(); - /** - * @brief Execute command - **/ - virtual void Run(); + /** + * @brief Execute command + **/ + virtual void Run(); - private: - DISALLOW_COPY_AND_ASSIGN(SDLActivateAppResponse); + private: + DISALLOW_COPY_AND_ASSIGN(SDLActivateAppResponse); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_request.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_request.h index 9625087d33..4f8d598322 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_request.h @@ -43,26 +43,27 @@ namespace commands { * @brief SDLGetListOfPermissionsRequest command class **/ class SDLGetListOfPermissionsRequest : public RequestFromHMI { - public: - /** - * @brief SDLGetListOfPermissionsRequest class constructor - * - * @param message Incoming SmartObject message - **/ - SDLGetListOfPermissionsRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + public: + /** + * @brief SDLGetListOfPermissionsRequest class constructor + * + * @param message Incoming SmartObject message + **/ + SDLGetListOfPermissionsRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief SDLGetListOfPermissionsRequest class destructor - **/ - virtual ~SDLGetListOfPermissionsRequest(); + /** + * @brief SDLGetListOfPermissionsRequest class destructor + **/ + virtual ~SDLGetListOfPermissionsRequest(); - /** - * @brief Execute command - **/ - virtual void Run(); + /** + * @brief Execute command + **/ + virtual void Run(); - private: - DISALLOW_COPY_AND_ASSIGN(SDLGetListOfPermissionsRequest); + private: + DISALLOW_COPY_AND_ASSIGN(SDLGetListOfPermissionsRequest); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_response.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_response.h index 6963bad639..e00e613e70 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_list_of_permissions_response.h @@ -43,26 +43,27 @@ namespace commands { * @brief SDLGetListOfPermissionsResponse command class **/ class SDLGetListOfPermissionsResponse : public ResponseToHMI { - public: - /** - * @brief SDLGetListOfPermissionsResponse class constructor - * - * @param message Incoming SmartObject message - **/ - SDLGetListOfPermissionsResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + public: + /** + * @brief SDLGetListOfPermissionsResponse class constructor + * + * @param message Incoming SmartObject message + **/ + SDLGetListOfPermissionsResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief SDLGetListOfPermissionsResponse class destructor - **/ - virtual ~SDLGetListOfPermissionsResponse(); + /** + * @brief SDLGetListOfPermissionsResponse class destructor + **/ + virtual ~SDLGetListOfPermissionsResponse(); - /** - * @brief Execute command - **/ - virtual void Run(); + /** + * @brief Execute command + **/ + virtual void Run(); - private: - DISALLOW_COPY_AND_ASSIGN(SDLGetListOfPermissionsResponse); + private: + DISALLOW_COPY_AND_ASSIGN(SDLGetListOfPermissionsResponse); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_status_update_request.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_status_update_request.h index 6ec05c4cdd..cfc0d55b54 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_status_update_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_status_update_request.h @@ -43,26 +43,27 @@ namespace commands { * @brief SDLGetStatusUpdateRequest command class **/ class SDLGetStatusUpdateRequest : public RequestFromHMI { - public: - /** - * @brief SDLGetStatusUpdateRequest class constructor - * - * @param message Incoming SmartObject message - **/ - SDLGetStatusUpdateRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + public: + /** + * @brief SDLGetStatusUpdateRequest class constructor + * + * @param message Incoming SmartObject message + **/ + SDLGetStatusUpdateRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief SDLGetStatusUpdateRequest class destructor - **/ - virtual ~SDLGetStatusUpdateRequest(); + /** + * @brief SDLGetStatusUpdateRequest class destructor + **/ + virtual ~SDLGetStatusUpdateRequest(); - /** - * @brief Execute command - **/ - virtual void Run(); + /** + * @brief Execute command + **/ + virtual void Run(); - private: - DISALLOW_COPY_AND_ASSIGN(SDLGetStatusUpdateRequest); + private: + DISALLOW_COPY_AND_ASSIGN(SDLGetStatusUpdateRequest); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_status_update_response.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_status_update_response.h index af5a36fc39..c25008bd90 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_status_update_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_status_update_response.h @@ -43,26 +43,27 @@ namespace commands { * @brief SDLGetStatusUpdateResponse command class **/ class SDLGetStatusUpdateResponse : public ResponseToHMI { - public: - /** - * @brief SDLGetStatusUpdateResponse class constructor - * - * @param message Incoming SmartObject message - **/ - SDLGetStatusUpdateResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + public: + /** + * @brief SDLGetStatusUpdateResponse class constructor + * + * @param message Incoming SmartObject message + **/ + SDLGetStatusUpdateResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief SDLGetStatusUpdateResponse class destructor - **/ - virtual ~SDLGetStatusUpdateResponse(); + /** + * @brief SDLGetStatusUpdateResponse class destructor + **/ + virtual ~SDLGetStatusUpdateResponse(); - /** - * @brief Execute command - **/ - virtual void Run(); + /** + * @brief Execute command + **/ + virtual void Run(); - private: - DISALLOW_COPY_AND_ASSIGN(SDLGetStatusUpdateResponse); + private: + DISALLOW_COPY_AND_ASSIGN(SDLGetStatusUpdateResponse); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_request.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_request.h index 103ec562af..7d9fec337c 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_request.h @@ -44,26 +44,27 @@ namespace commands { * @brief SDLGetUserFriendlyMessageRequest command class **/ class SDLGetUserFriendlyMessageRequest : public RequestFromHMI { - public: - /** - * @brief SDLGetUserFriendlyMessageRequest class constructor - * - * @param message Incoming SmartObject message - **/ - SDLGetUserFriendlyMessageRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + public: + /** + * @brief SDLGetUserFriendlyMessageRequest class constructor + * + * @param message Incoming SmartObject message + **/ + SDLGetUserFriendlyMessageRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief SDLGetUserFriendlyMessageRequest class destructor - **/ - virtual ~SDLGetUserFriendlyMessageRequest(); + /** + * @brief SDLGetUserFriendlyMessageRequest class destructor + **/ + virtual ~SDLGetUserFriendlyMessageRequest(); - /** - * @brief Execute command - **/ - virtual void Run(); + /** + * @brief Execute command + **/ + virtual void Run(); - private: - DISALLOW_COPY_AND_ASSIGN(SDLGetUserFriendlyMessageRequest); + private: + DISALLOW_COPY_AND_ASSIGN(SDLGetUserFriendlyMessageRequest); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_response.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_response.h index b32a20c5a3..43c440c277 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/sdl_get_user_friendly_message_response.h @@ -43,26 +43,27 @@ namespace commands { * @brief SDLGetUserFriendlyMessageResponse command class **/ class SDLGetUserFriendlyMessageResponse : public ResponseToHMI { - public: - /** - * @brief SDLGetUserFriendlyMessageResponse class constructor - * - * @param message Incoming SmartObject message - **/ - SDLGetUserFriendlyMessageResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + public: + /** + * @brief SDLGetUserFriendlyMessageResponse class constructor + * + * @param message Incoming SmartObject message + **/ + SDLGetUserFriendlyMessageResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief SDLGetUserFriendlyMessageResponse class destructor - **/ - virtual ~SDLGetUserFriendlyMessageResponse(); + /** + * @brief SDLGetUserFriendlyMessageResponse class destructor + **/ + virtual ~SDLGetUserFriendlyMessageResponse(); - /** - * @brief Execute command - **/ - virtual void Run(); + /** + * @brief Execute command + **/ + virtual void Run(); - private: - DISALLOW_COPY_AND_ASSIGN(SDLGetUserFriendlyMessageResponse); + private: + DISALLOW_COPY_AND_ASSIGN(SDLGetUserFriendlyMessageResponse); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_policy_update.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_policy_update.h index 75cd6888e9..11d0dc41d8 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/sdl_policy_update.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/sdl_policy_update.h @@ -40,20 +40,22 @@ namespace application_manager { namespace commands { class SDLPolicyUpdate : public RequestToHMI { - public: - /** - * @brief SDLPolicyUpdate class constructor - * - * @param message Incoming SmartObject message - **/ - SDLPolicyUpdate(const MessageSharedPtr& message, ApplicationManager& application_manager); - virtual ~SDLPolicyUpdate(); - /** - * @brief Execute command + public: + /** + * @brief SDLPolicyUpdate class constructor + * + * @param message Incoming SmartObject message **/ - virtual void Run(); - private: - DISALLOW_COPY_AND_ASSIGN(SDLPolicyUpdate); + SDLPolicyUpdate(const MessageSharedPtr& message, + ApplicationManager& application_manager); + virtual ~SDLPolicyUpdate(); + /** + * @brief Execute command + **/ + virtual void Run(); + + private: + DISALLOW_COPY_AND_ASSIGN(SDLPolicyUpdate); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/sdl_policy_update_response.h b/src/components/application_manager/include/application_manager/commands/hmi/sdl_policy_update_response.h index 86b46476b1..53e9e796bf 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/sdl_policy_update_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/sdl_policy_update_response.h @@ -40,26 +40,27 @@ namespace application_manager { namespace commands { class SDLPolicyUpdateResponse : public ResponseFromHMI { - public: - /** - * @brief SDLPolicyUpdateResponse class constructor - * - * @param message Incoming SmartObject message - **/ - SDLPolicyUpdateResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + public: + /** + * @brief SDLPolicyUpdateResponse class constructor + * + * @param message Incoming SmartObject message + **/ + SDLPolicyUpdateResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief SDLPolicyUpdateResponse class destructor - **/ - virtual ~SDLPolicyUpdateResponse(); + /** + * @brief SDLPolicyUpdateResponse class destructor + **/ + virtual ~SDLPolicyUpdateResponse(); - /** - * @brief Execute command - **/ - virtual void Run(); + /** + * @brief Execute command + **/ + virtual void Run(); - private: - DISALLOW_COPY_AND_ASSIGN(SDLPolicyUpdateResponse); + private: + DISALLOW_COPY_AND_ASSIGN(SDLPolicyUpdateResponse); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_change_registration_request.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_change_registration_request.h index 0558e19b7d..0f36e82b44 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/tts_change_registration_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/tts_change_registration_request.h @@ -49,7 +49,8 @@ class TTSChangeRegistrationRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - TTSChangeRegistrationRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + TTSChangeRegistrationRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief TTSChangeRegistrationRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_change_registration_response.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_change_registration_response.h index 81d9e7fda2..ca9c114156 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/tts_change_registration_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/tts_change_registration_response.h @@ -49,7 +49,8 @@ class TTSChangeRegistratioResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - TTSChangeRegistratioResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + TTSChangeRegistratioResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief TTSChangeRegistratioResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_capabilities_request.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_get_capabilities_request.h index 0d2edf713f..bea41b7371 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_capabilities_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/tts_get_capabilities_request.h @@ -49,7 +49,8 @@ class TTSGetCapabilitiesRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - TTSGetCapabilitiesRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + TTSGetCapabilitiesRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief TTSGetCapabilitiesRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_capabilities_response.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_get_capabilities_response.h index 324fbe7cef..a70ee2b33b 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_capabilities_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/tts_get_capabilities_response.h @@ -49,7 +49,8 @@ class TTSGetCapabilitiesResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - TTSGetCapabilitiesResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + TTSGetCapabilitiesResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief TTSGetCapabilitiesResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_language_request.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_get_language_request.h index 65ac2cd748..627cf3da06 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_language_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/tts_get_language_request.h @@ -49,7 +49,8 @@ class TTSGetLanguageRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - TTSGetLanguageRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + TTSGetLanguageRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief TTSGetLanguageRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_language_response.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_get_language_response.h index 1aee42921d..f44492a6ed 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_language_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/tts_get_language_response.h @@ -49,7 +49,8 @@ class TTSGetLanguageResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - TTSGetLanguageResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + TTSGetLanguageResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief TTSGetLanguageResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_supported_languages_request.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_get_supported_languages_request.h index 2a23b52b87..9500d54eea 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_supported_languages_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/tts_get_supported_languages_request.h @@ -49,7 +49,8 @@ class TTSGetSupportedLanguagesRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - TTSGetSupportedLanguagesRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + TTSGetSupportedLanguagesRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief TTSGetSupportedLanguagesRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_supported_languages_response.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_get_supported_languages_response.h index 8ed347c771..1bc569ebb8 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/tts_get_supported_languages_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/tts_get_supported_languages_response.h @@ -49,7 +49,8 @@ class TTSGetSupportedLanguagesResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - TTSGetSupportedLanguagesResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + TTSGetSupportedLanguagesResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief TTSGetSupportedLanguagesResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_is_ready_request.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_is_ready_request.h index fa80170564..81bd8eb27b 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/tts_is_ready_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/tts_is_ready_request.h @@ -49,7 +49,8 @@ class TTSIsReadyRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - TTSIsReadyRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + TTSIsReadyRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief TTSIsReadyRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_is_ready_response.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_is_ready_response.h index 1bcb46a6df..833d3d0a82 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/tts_is_ready_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/tts_is_ready_response.h @@ -49,7 +49,8 @@ class TTSIsReadyResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - TTSIsReadyResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + TTSIsReadyResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief TTSIsReadyResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_set_global_properties_request.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_set_global_properties_request.h index 36be2ba518..b18e372b3e 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/tts_set_global_properties_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/tts_set_global_properties_request.h @@ -49,7 +49,8 @@ class TTSSetGlobalPropertiesRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - TTSSetGlobalPropertiesRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + TTSSetGlobalPropertiesRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief TTSSetGlobalPropertiesRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_set_global_properties_response.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_set_global_properties_response.h index 6b9e227131..aa7c85eece 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/tts_set_global_properties_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/tts_set_global_properties_response.h @@ -49,7 +49,8 @@ class TTSSetGlobalPropertiesResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - TTSSetGlobalPropertiesResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + TTSSetGlobalPropertiesResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief TTSSetGlobalPropertiesResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_speak_request.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_speak_request.h index b79fa4eba7..87384beedf 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/tts_speak_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/tts_speak_request.h @@ -42,15 +42,15 @@ namespace commands { /** * @brief TTSSpeakRequest command class **/ -class TTSSpeakRequest - : public RequestToHMI { +class TTSSpeakRequest : public RequestToHMI { public: /** * @brief TTSSpeakRequest class constructor * * @param message Incoming SmartObject message **/ - TTSSpeakRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + TTSSpeakRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief TTSSpeakRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_speak_response.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_speak_response.h index bba7fe6814..9f15afb33b 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/tts_speak_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/tts_speak_response.h @@ -42,15 +42,15 @@ namespace commands { /** * @brief TTSSpeakResponse command class **/ -class TTSSpeakResponse - : public ResponseFromHMI { +class TTSSpeakResponse : public ResponseFromHMI { public: /** * @brief TTSSpeakResponse class constructor * * @param message Incoming SmartObject message **/ - TTSSpeakResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + TTSSpeakResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief TTSSpeakResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_stop_speaking_request.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_stop_speaking_request.h index f663240cfc..c51daee84d 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/tts_stop_speaking_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/tts_stop_speaking_request.h @@ -49,7 +49,8 @@ class TTSStopSpeakingRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - TTSStopSpeakingRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + TTSStopSpeakingRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief TTSStopSpeakingRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/tts_stop_speaking_response.h b/src/components/application_manager/include/application_manager/commands/hmi/tts_stop_speaking_response.h index fe7fc28702..a23889a733 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/tts_stop_speaking_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/tts_stop_speaking_response.h @@ -49,7 +49,8 @@ class TTSStopSpeakingResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - TTSStopSpeakingResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + TTSStopSpeakingResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief TTSStopSpeakingResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_add_command_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_add_command_request.h index 8b6c349051..294fd11912 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_add_command_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_add_command_request.h @@ -49,7 +49,8 @@ class UIAddCommandRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - UIAddCommandRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + UIAddCommandRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UIAddCommandRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_add_command_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_add_command_response.h index 1d57a24a1f..ed48e13322 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_add_command_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_add_command_response.h @@ -49,7 +49,8 @@ class UIAddCommandResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - UIAddCommandResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + UIAddCommandResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UIAddCommandResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_add_submenu_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_add_submenu_request.h index 5f5244869a..96fa0557ae 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_add_submenu_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_add_submenu_request.h @@ -49,7 +49,8 @@ class UIAddSubmenuRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - UIAddSubmenuRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + UIAddSubmenuRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UIAddSubmenuRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_add_submenu_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_add_submenu_response.h index bb214b05d4..62abf10b60 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_add_submenu_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_add_submenu_response.h @@ -49,7 +49,8 @@ class UIAddSubmenuResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - UIAddSubmenuResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + UIAddSubmenuResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UIAddSubmenuResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_alert_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_alert_request.h index 7f728335a7..123246e596 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_alert_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_alert_request.h @@ -49,7 +49,8 @@ class UIAlertRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - UIAlertRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + UIAlertRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UIAlertRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_alert_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_alert_response.h index 1856b1f3db..db48699a23 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_alert_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_alert_response.h @@ -49,7 +49,8 @@ class UIAlertResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - UIAlertResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + UIAlertResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UIAlertResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_change_registration_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_change_registration_request.h index 22dda65be7..744ed82cad 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_change_registration_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_change_registration_request.h @@ -49,7 +49,8 @@ class UIChangeRegistrationRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - UIChangeRegistrationRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + UIChangeRegistrationRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UIChangeRegistrationRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_change_registration_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_change_registration_response.h index 7e63b8e10e..57814b9acf 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_change_registration_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_change_registration_response.h @@ -49,7 +49,8 @@ class UIChangeRegistratioResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - UIChangeRegistratioResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + UIChangeRegistratioResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UIChangeRegistratioResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_command_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_command_request.h index c3dd651a12..21a4c6dd42 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_command_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_command_request.h @@ -49,7 +49,8 @@ class UIDeleteCommandRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - UIDeleteCommandRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + UIDeleteCommandRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UIDeleteCommandRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_command_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_command_response.h index 2d048f507c..c9baba728f 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_command_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_command_response.h @@ -49,7 +49,8 @@ class UIDeleteCommandResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - UIDeleteCommandResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + UIDeleteCommandResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UIDeleteCommandResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_submenu_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_submenu_request.h index b80e4ff961..d238e39a10 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_submenu_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_submenu_request.h @@ -49,7 +49,8 @@ class UIDeleteSubmenuRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - UIDeleteSubmenuRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + UIDeleteSubmenuRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UIDeleteSubmenuRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_submenu_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_submenu_response.h index faf4cbf561..36d7bee528 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_submenu_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_delete_submenu_response.h @@ -49,7 +49,8 @@ class UIDeleteSubmenuResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - UIDeleteSubmenuResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + UIDeleteSubmenuResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UIDeleteSubmenuResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_end_audio_pass_thru_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_end_audio_pass_thru_request.h index 769fcc8cbe..d8bd10a9ca 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_end_audio_pass_thru_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_end_audio_pass_thru_request.h @@ -50,7 +50,8 @@ class UIEndAudioPassThruRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - UIEndAudioPassThruRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + UIEndAudioPassThruRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UIEndAudioPassThruRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_end_audio_pass_thru_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_end_audio_pass_thru_response.h index 5cf923bc04..c2a373d8c0 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_end_audio_pass_thru_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_end_audio_pass_thru_response.h @@ -49,7 +49,8 @@ class UIEndAudioPassThruResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - UIEndAudioPassThruResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + UIEndAudioPassThruResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UIEndAudioPassThruResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_capabilities_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_get_capabilities_request.h index 50c428c216..cffba5ca42 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_capabilities_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_get_capabilities_request.h @@ -49,7 +49,8 @@ class UIGetCapabilitiesRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - UIGetCapabilitiesRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + UIGetCapabilitiesRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UIGetCapabilitiesRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_capabilities_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_get_capabilities_response.h index e428128859..525dd7ad9d 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_capabilities_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_get_capabilities_response.h @@ -49,7 +49,8 @@ class UIGetCapabilitiesResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - UIGetCapabilitiesResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + UIGetCapabilitiesResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UIGetCapabilitiesResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_language_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_get_language_request.h index 470072f725..4bf8e11d7e 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_language_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_get_language_request.h @@ -49,7 +49,8 @@ class UIGetLanguageRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - UIGetLanguageRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + UIGetLanguageRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UIGetLanguageRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_language_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_get_language_response.h index cefa4e70b9..29bbba85ff 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_language_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_get_language_response.h @@ -49,7 +49,8 @@ class UIGetLanguageResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - UIGetLanguageResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + UIGetLanguageResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UIGetLanguageResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_supported_languages_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_get_supported_languages_request.h index d499de829f..94c197b7bc 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_supported_languages_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_get_supported_languages_request.h @@ -49,7 +49,8 @@ class UIGetSupportedLanguagesRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - UIGetSupportedLanguagesRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + UIGetSupportedLanguagesRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UIGetSupportedLanguagesRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_supported_languages_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_get_supported_languages_response.h index d06d79a7ef..8962b77833 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_get_supported_languages_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_get_supported_languages_response.h @@ -49,7 +49,8 @@ class UIGetSupportedLanguagesResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - UIGetSupportedLanguagesResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + UIGetSupportedLanguagesResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UIGetSupportedLanguagesResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_request.h index 61ea93cfdc..a505df6de4 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_request.h @@ -49,7 +49,8 @@ class UIIsReadyRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - UIIsReadyRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + UIIsReadyRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UIIsReadyRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_response.h index 251884d0ab..93b2d9a569 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_is_ready_response.h @@ -49,7 +49,8 @@ class UIIsReadyResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - UIIsReadyResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + UIIsReadyResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UIIsReadyResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h index 8c71cd7b51..4cec5a5600 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_request.h @@ -49,7 +49,8 @@ class UIPerformAudioPassThruRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - UIPerformAudioPassThruRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + UIPerformAudioPassThruRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UIPerformAudioPassThruRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h index 458d72a960..9fb502233f 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_audio_pass_thru_response.h @@ -49,7 +49,8 @@ class UIPerformAudioPassThruResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - UIPerformAudioPassThruResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + UIPerformAudioPassThruResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UIPerformAudioPassThruResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_interaction_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_interaction_request.h index 01d168927f..d9ae72a319 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_interaction_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_interaction_request.h @@ -49,7 +49,8 @@ class UIPerformInteractionRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - UIPerformInteractionRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + UIPerformInteractionRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UIPerformInteractionRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_interaction_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_interaction_response.h index bc00e184bd..4db471bbae 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_interaction_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_perform_interaction_response.h @@ -49,7 +49,8 @@ class UIPerformInteractionResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - UIPerformInteractionResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + UIPerformInteractionResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UIPerformInteractionResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_scrollable_message_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_scrollable_message_request.h index f3d451253a..8ba828a25e 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_scrollable_message_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_scrollable_message_request.h @@ -49,7 +49,8 @@ class UIScrollableMessageRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - UIScrollableMessageRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + UIScrollableMessageRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UIScrollableMessageRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_scrollable_message_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_scrollable_message_response.h index 29242fec50..4ae432d658 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_scrollable_message_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_scrollable_message_response.h @@ -49,7 +49,8 @@ class UIScrollableMessageResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - UIScrollableMessageResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + UIScrollableMessageResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UIScrollableMessageResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_app_icon_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_app_icon_request.h index ab56c7a9ba..c016cf7cda 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_app_icon_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_app_icon_request.h @@ -49,7 +49,8 @@ class UISetAppIconRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - UISetAppIconRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + UISetAppIconRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UISetIconRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_app_icon_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_app_icon_response.h index 16671b2cea..640e43c9f4 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_app_icon_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_app_icon_response.h @@ -49,7 +49,8 @@ class UISetAppIconResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - UISetAppIconResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + UISetAppIconResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UISetIconResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_display_layout_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_display_layout_request.h index 95a1f73179..573e9351b1 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_display_layout_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_display_layout_request.h @@ -42,26 +42,27 @@ namespace commands { * @brief UiSetDisplayLayoutRequest command class **/ class UiSetDisplayLayoutRequest : public RequestToHMI { - public: - /** - * @brief UiSetDisplayLayoutRequest class constructor - * - * @param message Incoming SmartObject message - **/ - UiSetDisplayLayoutRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + public: + /** + * @brief UiSetDisplayLayoutRequest class constructor + * + * @param message Incoming SmartObject message + **/ + UiSetDisplayLayoutRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief UiSetDisplayLayoutRequest class destructor - **/ - virtual ~UiSetDisplayLayoutRequest(); + /** + * @brief UiSetDisplayLayoutRequest class destructor + **/ + virtual ~UiSetDisplayLayoutRequest(); - /** - * @brief Execute command - **/ - virtual void Run(); + /** + * @brief Execute command + **/ + virtual void Run(); - private: - DISALLOW_COPY_AND_ASSIGN(UiSetDisplayLayoutRequest); + private: + DISALLOW_COPY_AND_ASSIGN(UiSetDisplayLayoutRequest); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_display_layout_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_display_layout_response.h index 3267848671..7b8098fdf5 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_display_layout_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_display_layout_response.h @@ -43,26 +43,27 @@ namespace commands { * @brief UiSetDisplayLayoutResponse command class **/ class UiSetDisplayLayoutResponse : public ResponseFromHMI { - public: - /** - * @brief UiSetDisplayLayoutResponse class constructor - * - * @param message Incoming SmartObject message - **/ - UiSetDisplayLayoutResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + public: + /** + * @brief UiSetDisplayLayoutResponse class constructor + * + * @param message Incoming SmartObject message + **/ + UiSetDisplayLayoutResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief UiSetDisplayLayoutResponse class destructor - **/ - virtual ~UiSetDisplayLayoutResponse(); + /** + * @brief UiSetDisplayLayoutResponse class destructor + **/ + virtual ~UiSetDisplayLayoutResponse(); - /** - * @brief Execute command - **/ - virtual void Run(); + /** + * @brief Execute command + **/ + virtual void Run(); - private: - DISALLOW_COPY_AND_ASSIGN(UiSetDisplayLayoutResponse); + private: + DISALLOW_COPY_AND_ASSIGN(UiSetDisplayLayoutResponse); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_global_properties_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_global_properties_request.h index 9d69ad457f..83bf11e2e1 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_global_properties_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_global_properties_request.h @@ -49,7 +49,8 @@ class UISetGlobalPropertiesRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - UISetGlobalPropertiesRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + UISetGlobalPropertiesRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UIShowRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_global_properties_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_global_properties_response.h index 851b289e6a..91de5e6df7 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_global_properties_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_global_properties_response.h @@ -49,7 +49,8 @@ class UISetGlobalPropertiesResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - UISetGlobalPropertiesResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + UISetGlobalPropertiesResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UISetGlobalPropertiesResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_media_clock_timer_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_media_clock_timer_request.h index 535390ee2d..92565e6f02 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_media_clock_timer_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_media_clock_timer_request.h @@ -49,7 +49,8 @@ class UISetMediaClockTimerRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - UISetMediaClockTimerRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + UISetMediaClockTimerRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UISetMediaClockTimerRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_media_clock_timer_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_media_clock_timer_response.h index d20ddb1108..0d71ff00f0 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_set_media_clock_timer_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_set_media_clock_timer_response.h @@ -49,7 +49,8 @@ class UISetMediaClockTimerResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - UISetMediaClockTimerResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + UISetMediaClockTimerResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UISetMediaClockTimerResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_show_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_show_request.h index a231e857c5..80348de63b 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_show_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_show_request.h @@ -49,7 +49,8 @@ class UIShowRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - UIShowRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + UIShowRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UIShowRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_show_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_show_response.h index aef0f9dfc3..d696d2b9f8 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_show_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_show_response.h @@ -49,7 +49,8 @@ class UIShowResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - UIShowResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + UIShowResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UIShowResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_slider_request.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_slider_request.h index a7d03444a5..583f52084d 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_slider_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_slider_request.h @@ -49,7 +49,8 @@ class UISliderRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - UISliderRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + UISliderRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UISliderRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/ui_slider_response.h b/src/components/application_manager/include/application_manager/commands/hmi/ui_slider_response.h index 85e664be28..cabb54f6cb 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/ui_slider_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/ui_slider_response.h @@ -49,7 +49,8 @@ class UISliderResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - UISliderResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + UISliderResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UISliderResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/update_app_list_request.h b/src/components/application_manager/include/application_manager/commands/hmi/update_app_list_request.h index 672310ae90..61be04d04f 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/update_app_list_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/update_app_list_request.h @@ -49,7 +49,8 @@ class UpdateAppListRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - UpdateAppListRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + UpdateAppListRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UpdateAppListRequest class destructor @@ -70,4 +71,3 @@ class UpdateAppListRequest : public RequestToHMI { } // namespace application_manager #endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_HMI_UPDATE_APP_LIST_REQUEST_H_ - diff --git a/src/components/application_manager/include/application_manager/commands/hmi/update_app_list_response.h b/src/components/application_manager/include/application_manager/commands/hmi/update_app_list_response.h index 53bc796a22..5ff8948393 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/update_app_list_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/update_app_list_response.h @@ -49,7 +49,8 @@ class UpdateAppListResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - UpdateAppListResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + UpdateAppListResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UpdateAppListResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/update_device_list_request.h b/src/components/application_manager/include/application_manager/commands/hmi/update_device_list_request.h index 298b4187c2..c52ec96075 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/update_device_list_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/update_device_list_request.h @@ -53,7 +53,8 @@ class UpdateDeviceListRequest : public RequestToHMI, * * @param message Incoming SmartObject message **/ - UpdateDeviceListRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + UpdateDeviceListRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UpdateDeviceListRequest class destructor @@ -73,14 +74,14 @@ class UpdateDeviceListRequest : public RequestToHMI, */ virtual void on_event(const event_engine::Event& event); - /** - * @brief Need to stop execution StopMethod if HMI did not started - */ + /** + * @brief Need to stop execution StopMethod if HMI did not started + */ virtual bool CleanUp(); private: - sync_primitives::Lock wait_hmi_lock; - sync_primitives::ConditionalVariable termination_condition_; + sync_primitives::Lock wait_hmi_lock; + sync_primitives::ConditionalVariable termination_condition_; DISALLOW_COPY_AND_ASSIGN(UpdateDeviceListRequest); }; diff --git a/src/components/application_manager/include/application_manager/commands/hmi/update_device_list_response.h b/src/components/application_manager/include/application_manager/commands/hmi/update_device_list_response.h index ef040f94d4..1928b81207 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/update_device_list_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/update_device_list_response.h @@ -43,26 +43,27 @@ namespace commands { * @brief UpdateDeviceListResponse command class **/ class UpdateDeviceListResponse : public ResponseFromHMI { - public: - /** - * @brief UpdateDeviceListResponse class constructor - * - * @param message Incoming SmartObject message - **/ - UpdateDeviceListResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + public: + /** + * @brief UpdateDeviceListResponse class constructor + * + * @param message Incoming SmartObject message + **/ + UpdateDeviceListResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief UpdateDeviceListResponse class destructor - **/ - virtual ~UpdateDeviceListResponse(); + /** + * @brief UpdateDeviceListResponse class destructor + **/ + virtual ~UpdateDeviceListResponse(); - /** - * @brief Execute command - **/ - virtual void Run(); + /** + * @brief Execute command + **/ + virtual void Run(); - private: - DISALLOW_COPY_AND_ASSIGN(UpdateDeviceListResponse); + private: + DISALLOW_COPY_AND_ASSIGN(UpdateDeviceListResponse); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/update_sdl_request.h b/src/components/application_manager/include/application_manager/commands/hmi/update_sdl_request.h index 872f2e5798..d8be10da2e 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/update_sdl_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/update_sdl_request.h @@ -50,7 +50,8 @@ class UpdateSDLRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - UpdateSDLRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + UpdateSDLRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UpdateSDLRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/update_sdl_response.h b/src/components/application_manager/include/application_manager/commands/hmi/update_sdl_response.h index a833a9b55b..bc0375d5fa 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/update_sdl_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/update_sdl_response.h @@ -49,7 +49,8 @@ class UpdateSDLResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - UpdateSDLResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + UpdateSDLResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UpdateSDLResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_diagnostic_message_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_diagnostic_message_request.h index e4396fc031..099f27b734 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/vi_diagnostic_message_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_diagnostic_message_request.h @@ -49,7 +49,8 @@ class VIDiagnosticMessageRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - VIDiagnosticMessageRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + VIDiagnosticMessageRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief VIDiagnosticMessageRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_diagnostic_message_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_diagnostic_message_response.h index 67fbd0e493..f0ae76ccb7 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/vi_diagnostic_message_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_diagnostic_message_response.h @@ -49,7 +49,8 @@ class VIDiagnosticMessageResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - VIDiagnosticMessageResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + VIDiagnosticMessageResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief VIDiagnosticMessageResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_dtcs_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_dtcs_request.h index ce2ee9f355..3b7e502a57 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_dtcs_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_dtcs_request.h @@ -49,7 +49,8 @@ class VIGetDTCsRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - VIGetDTCsRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + VIGetDTCsRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief VIGetDTCsRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_dtcs_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_dtcs_response.h index 73de095a83..7b7dab567b 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_dtcs_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_dtcs_response.h @@ -49,7 +49,8 @@ class VIGetDTCsResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - VIGetDTCsResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + VIGetDTCsResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief VIGetDTCsResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_request.h index 087bfef207..006f18e864 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_request.h @@ -49,7 +49,8 @@ class VIGetVehicleDataRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - VIGetVehicleDataRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + VIGetVehicleDataRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief VIGetVehicleDataRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_request_template.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_request_template.h index 913b62b431..a11c763021 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_request_template.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_request_template.h @@ -44,7 +44,7 @@ namespace commands { * * Template class for sending 1 subscribe thin request **/ -template<event_engine::Event::EventID eventID> +template <event_engine::Event::EventID eventID> class VIGetVehicleDataRequestTemplate : public RequestToHMI { public: /** @@ -52,9 +52,9 @@ class VIGetVehicleDataRequestTemplate : public RequestToHMI { * * @param message Incoming SmartObject message **/ - VIGetVehicleDataRequestTemplate(const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { - } + VIGetVehicleDataRequestTemplate(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} /** * @brief Execute command with sending DBus thin request to HMI diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_response.h index d7fe667f3c..ef19072bb0 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_response.h @@ -50,7 +50,8 @@ class VIGetVehicleDataResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - VIGetVehicleDataResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + VIGetVehicleDataResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief VIGetVehicleDataResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_response_template.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_response_template.h index b43dd3d7e4..a1c143baed 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_response_template.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_data_response_template.h @@ -43,7 +43,7 @@ namespace commands { /** * @brief VIGetVehicleDataResponseTemplate command class **/ -template<event_engine::Event::EventID eventID> +template <event_engine::Event::EventID eventID> class VIGetVehicleDataResponseTemplate : public ResponseFromHMI { public: /** @@ -51,9 +51,9 @@ class VIGetVehicleDataResponseTemplate : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - VIGetVehicleDataResponseTemplate(const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { - } + VIGetVehicleDataResponseTemplate(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} /** * @brief Execute command diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_type_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_type_request.h index 04af5903e9..cd70c3349b 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_type_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_type_request.h @@ -49,7 +49,8 @@ class VIGetVehicleTypeRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - VIGetVehicleTypeRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + VIGetVehicleTypeRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief VIGetVehicleTypeRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_type_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_type_response.h index ee74b8478c..0ef35dd7fc 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_type_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_get_vehicle_type_response.h @@ -49,7 +49,8 @@ class VIGetVehicleTypeResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - VIGetVehicleTypeResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + VIGetVehicleTypeResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief VIGetVehicleTypeResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_is_ready_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_is_ready_request.h index a1df2bd990..9049db4d24 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/vi_is_ready_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_is_ready_request.h @@ -49,7 +49,8 @@ class VIIsReadyRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - VIIsReadyRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + VIIsReadyRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief VIIsReadyRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_is_ready_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_is_ready_response.h index b19aea7a63..a7866a1e73 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/vi_is_ready_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_is_ready_response.h @@ -50,7 +50,8 @@ class VIIsReadyResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - VIIsReadyResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + VIIsReadyResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief VIIsReadyResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_read_did_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_read_did_request.h index 358076ef23..cdbdb45a8b 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/vi_read_did_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_read_did_request.h @@ -49,7 +49,8 @@ class VIReadDIDRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - VIReadDIDRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + VIReadDIDRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief VIReadDIDRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_read_did_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_read_did_response.h index 8d95f12bd4..acb8760c5b 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/vi_read_did_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_read_did_response.h @@ -49,7 +49,8 @@ class VIReadDIDResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - VIReadDIDResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + VIReadDIDResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief VIReadDIDResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h index 0ef5b4e9f2..58d4984f8d 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request.h @@ -49,7 +49,8 @@ class VISubscribeVehicleDataRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - VISubscribeVehicleDataRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + VISubscribeVehicleDataRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief VISubscribeVehicleDataRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h index 385bd4d029..7fefe0dbe2 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_request_template.h @@ -44,7 +44,7 @@ namespace commands { * * Template class for sending 1 subscribe thin request **/ -template<event_engine::Event::EventID eventID> +template <event_engine::Event::EventID eventID> class VISubscribeVehicleDataRequestTemplate : public RequestToHMI { public: /** @@ -52,10 +52,9 @@ class VISubscribeVehicleDataRequestTemplate : public RequestToHMI { * * @param message Incoming SmartObject message **/ - VISubscribeVehicleDataRequestTemplate( - const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { - } + VISubscribeVehicleDataRequestTemplate(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} /** * @brief Execute command with sending DBus thin request to HMI diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h index 8494894787..8f038bf941 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h @@ -49,7 +49,8 @@ class VISubscribeVehicleDataResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - VISubscribeVehicleDataResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + VISubscribeVehicleDataResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief VISubscribeVehicleDataResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h index 5262a6992c..7790c57092 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_subscribe_vehicle_data_response_template.h @@ -42,7 +42,7 @@ namespace commands { /** * @brief VISubscriveVehicleDataResponseTemplate command class **/ -template<event_engine::Event::EventID eventID> +template <event_engine::Event::EventID eventID> class VISubscribeVehicleDataResponseTemplate : public ResponseFromHMI { public: /** @@ -52,8 +52,7 @@ class VISubscribeVehicleDataResponseTemplate : public ResponseFromHMI { **/ VISubscribeVehicleDataResponseTemplate( const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { - } + : ResponseFromHMI(message, application_manager) {} /** * @brief Execute command @@ -64,6 +63,7 @@ class VISubscribeVehicleDataResponseTemplate : public ResponseFromHMI { event.set_smart_object(*message_); event.raise(application_manager_.event_dispatcher()); } + private: DISALLOW_COPY_AND_ASSIGN(VISubscribeVehicleDataResponseTemplate<eventID>); }; diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h index 14e510c412..b99eee47e7 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h @@ -49,7 +49,8 @@ class VIUnsubscribeVehicleDataRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - VIUnsubscribeVehicleDataRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + VIUnsubscribeVehicleDataRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief VIUnsubscribeVehicleDataRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h index 070d1aba5c..b9367a372e 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request_template.h @@ -44,7 +44,7 @@ namespace commands { * * Template class for sending 1 unsubscribe thin request **/ -template<event_engine::Event::EventID eventID> +template <event_engine::Event::EventID eventID> class VIUnsubscribeVehicleDataRequestTemplate : public RequestToHMI { public: /** @@ -54,8 +54,7 @@ class VIUnsubscribeVehicleDataRequestTemplate : public RequestToHMI { **/ VIUnsubscribeVehicleDataRequestTemplate( const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { - } + : RequestToHMI(message, application_manager) {} /** * @brief Execute command with sending DBus thin request to HMI diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h index 3febb1f035..3f930b5a5b 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h @@ -49,7 +49,8 @@ class VIUnsubscribeVehicleDataResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - VIUnsubscribeVehicleDataResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + VIUnsubscribeVehicleDataResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief VIUnsubscribeVehicleDataResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h b/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h index ed4c7f3e1f..9d943b838d 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response_template.h @@ -43,7 +43,7 @@ namespace commands { /** * @brief VIUnsubscriveVehicleDataResponseTemplate command class **/ -template<event_engine::Event::EventID eventID> +template <event_engine::Event::EventID eventID> class VIUnsubscribeVehicleDataResponseTemplate : public ResponseFromHMI { public: /** @@ -53,8 +53,7 @@ class VIUnsubscribeVehicleDataResponseTemplate : public ResponseFromHMI { **/ VIUnsubscribeVehicleDataResponseTemplate( const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { - } + : ResponseFromHMI(message, application_manager) {} /** * @brief Execute command @@ -65,6 +64,7 @@ class VIUnsubscribeVehicleDataResponseTemplate : public ResponseFromHMI { event.set_smart_object(*message_); event.raise(application_manager_.event_dispatcher()); } + private: DISALLOW_COPY_AND_ASSIGN(VIUnsubscribeVehicleDataResponseTemplate<eventID>); }; diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_add_command_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_add_command_request.h index 95c80e4e99..1ef4125c89 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/vr_add_command_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/vr_add_command_request.h @@ -49,7 +49,8 @@ class VRAddCommandRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - VRAddCommandRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + VRAddCommandRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief VRAddCommandRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_add_command_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_add_command_response.h index 7d2a7e2ba5..1b419ed6ec 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/vr_add_command_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/vr_add_command_response.h @@ -49,7 +49,8 @@ class VRAddCommandResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - VRAddCommandResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + VRAddCommandResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief VRAddCommandResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_change_registration_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_change_registration_request.h index 041f971b84..642319e8d6 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/vr_change_registration_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/vr_change_registration_request.h @@ -49,7 +49,8 @@ class VRChangeRegistrationRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - VRChangeRegistrationRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + VRChangeRegistrationRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief VRChangeRegistrationRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_change_registration_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_change_registration_response.h index 0085088760..8dc5e96729 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/vr_change_registration_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/vr_change_registration_response.h @@ -49,7 +49,8 @@ class VRChangeRegistrationResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - VRChangeRegistrationResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + VRChangeRegistrationResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief VRChangeRegistrationResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_delete_command_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_delete_command_request.h index 78f8670da6..bc5c24a350 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/vr_delete_command_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/vr_delete_command_request.h @@ -49,7 +49,8 @@ class VRDeleteCommandRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - VRDeleteCommandRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + VRDeleteCommandRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief VRDeleteCommandRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_delete_command_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_delete_command_response.h index 25229af8e8..526c296321 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/vr_delete_command_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/vr_delete_command_response.h @@ -49,7 +49,8 @@ class VRDeleteCommandResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - VRDeleteCommandResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + VRDeleteCommandResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief VRDeleteCommandResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_request.h index 9f877c41a9..8dcc240e9b 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_request.h @@ -43,26 +43,27 @@ namespace commands { * @brief VRGetCapabilitiesRequest command class **/ class VRGetCapabilitiesRequest : public RequestToHMI { - public: - /** - * @brief VRGetCapabilitiesRequest class constructor - * - * @param message Incoming SmartObject message - **/ - VRGetCapabilitiesRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + public: + /** + * @brief VRGetCapabilitiesRequest class constructor + * + * @param message Incoming SmartObject message + **/ + VRGetCapabilitiesRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief VRGetCapabilitiesRequest class destructor - **/ - virtual ~VRGetCapabilitiesRequest(); + /** + * @brief VRGetCapabilitiesRequest class destructor + **/ + virtual ~VRGetCapabilitiesRequest(); - /** - * @brief Execute command - **/ - virtual void Run(); + /** + * @brief Execute command + **/ + virtual void Run(); - private: - DISALLOW_COPY_AND_ASSIGN(VRGetCapabilitiesRequest); + private: + DISALLOW_COPY_AND_ASSIGN(VRGetCapabilitiesRequest); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_response.h index 8a75a2485b..b6c8e081f5 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_capabilities_response.h @@ -43,26 +43,27 @@ namespace commands { * @brief VRGetCapabilitiesResponse command class **/ class VRGetCapabilitiesResponse : public ResponseFromHMI { - public: - /** - * @brief VRGetCapabilitiesResponse class constructor - * - * @param message Incoming SmartObject message - **/ - VRGetCapabilitiesResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + public: + /** + * @brief VRGetCapabilitiesResponse class constructor + * + * @param message Incoming SmartObject message + **/ + VRGetCapabilitiesResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief VRGetCapabilitiesResponse class destructor - **/ - virtual ~VRGetCapabilitiesResponse(); + /** + * @brief VRGetCapabilitiesResponse class destructor + **/ + virtual ~VRGetCapabilitiesResponse(); - /** - * @brief Execute command - **/ - virtual void Run(); + /** + * @brief Execute command + **/ + virtual void Run(); - private: - DISALLOW_COPY_AND_ASSIGN(VRGetCapabilitiesResponse); + private: + DISALLOW_COPY_AND_ASSIGN(VRGetCapabilitiesResponse); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_language_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_language_request.h index a8bdf7450f..05373784f3 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_language_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_language_request.h @@ -49,7 +49,8 @@ class VRGetLanguageRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - VRGetLanguageRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + VRGetLanguageRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief VRGetLanguageRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_language_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_language_response.h index 2d027de578..fad2f219df 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_language_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_language_response.h @@ -49,7 +49,8 @@ class VRGetLanguageResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - VRGetLanguageResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + VRGetLanguageResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief VRGetLanguageResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_supported_languages_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_supported_languages_request.h index 9da9a3394c..6ed56ebd32 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_supported_languages_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_supported_languages_request.h @@ -49,7 +49,8 @@ class VRGetSupportedLanguagesRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - VRGetSupportedLanguagesRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + VRGetSupportedLanguagesRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief VRGetSupportedLanguagesRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_supported_languages_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_supported_languages_response.h index 29f4c58b6e..c4e742ecd0 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/vr_get_supported_languages_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/vr_get_supported_languages_response.h @@ -49,7 +49,8 @@ class VRGetSupportedLanguagesResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - VRGetSupportedLanguagesResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + VRGetSupportedLanguagesResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief VRGetSupportedLanguagesResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_is_ready_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_is_ready_request.h index 0c5d9a1db1..9fc4ccd2f3 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/vr_is_ready_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/vr_is_ready_request.h @@ -49,7 +49,8 @@ class VRIsReadyRequest : public RequestToHMI { * * @param message Incoming SmartObject message **/ - VRIsReadyRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + VRIsReadyRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief VRIsReadyRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_is_ready_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_is_ready_response.h index 3fe226e9b7..474b3373a3 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/vr_is_ready_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/vr_is_ready_response.h @@ -49,7 +49,8 @@ class VRIsReadyResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - VRIsReadyResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + VRIsReadyResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief VRIsReadyResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_perform_interaction_request.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_perform_interaction_request.h index 8737128826..35a7e80b06 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/vr_perform_interaction_request.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/vr_perform_interaction_request.h @@ -43,26 +43,27 @@ namespace commands { * @brief VRPerformInteractionRequest command class **/ class VRPerformInteractionRequest : public RequestToHMI { - public: - /** - * @brief VRPerformInteractionRequest class constructor - * - * @param message Incoming SmartObject message - **/ - VRPerformInteractionRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + public: + /** + * @brief VRPerformInteractionRequest class constructor + * + * @param message Incoming SmartObject message + **/ + VRPerformInteractionRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief VRPerformInteractionRequest class destructor - **/ - virtual ~VRPerformInteractionRequest(); + /** + * @brief VRPerformInteractionRequest class destructor + **/ + virtual ~VRPerformInteractionRequest(); - /** - * @brief Execute command - **/ - virtual void Run(); + /** + * @brief Execute command + **/ + virtual void Run(); - private: - DISALLOW_COPY_AND_ASSIGN(VRPerformInteractionRequest); + private: + DISALLOW_COPY_AND_ASSIGN(VRPerformInteractionRequest); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/hmi/vr_perform_interaction_response.h b/src/components/application_manager/include/application_manager/commands/hmi/vr_perform_interaction_response.h index 5f1b870542..7c445416ce 100644 --- a/src/components/application_manager/include/application_manager/commands/hmi/vr_perform_interaction_response.h +++ b/src/components/application_manager/include/application_manager/commands/hmi/vr_perform_interaction_response.h @@ -49,7 +49,8 @@ class VRPerformInteractionResponse : public ResponseFromHMI { * * @param message Incoming SmartObject message **/ - VRPerformInteractionResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + VRPerformInteractionResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief TTSPerformInteractionResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/add_command_request.h b/src/components/application_manager/include/application_manager/commands/mobile/add_command_request.h index 39ffef24a8..22a0c7e85f 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/add_command_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/add_command_request.h @@ -52,7 +52,8 @@ class AddCommandRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - AddCommandRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + AddCommandRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief AddCommandRequest class destructor @@ -72,7 +73,6 @@ class AddCommandRequest : public CommandRequestImpl { void on_event(const event_engine::Event& event); private: - /* * @brief Check if command name doesn't exist in application * Please see SDLAQ-CRS-407 for more information diff --git a/src/components/application_manager/include/application_manager/commands/mobile/add_command_response.h b/src/components/application_manager/include/application_manager/commands/mobile/add_command_response.h index ef9c810bfe..84bcdebc31 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/add_command_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/add_command_response.h @@ -51,7 +51,8 @@ class AddCommandResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - AddCommandResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + AddCommandResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief AddCommandResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_request.h b/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_request.h index b36cb46545..1f12523953 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_request.h @@ -51,7 +51,8 @@ class AddSubMenuRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - AddSubMenuRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + AddSubMenuRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief AddSubMenuRequest class destructor @@ -71,7 +72,6 @@ class AddSubMenuRequest : public CommandRequestImpl { void on_event(const event_engine::Event& event); private: - /* * @brief Check if submenu name is valid * diff --git a/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_response.h b/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_response.h index 51d70cc615..4d71e5f017 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/add_sub_menu_response.h @@ -51,7 +51,8 @@ class AddSubMenuResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - AddSubMenuResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + AddSubMenuResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief AddSubMenuResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_request.h b/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_request.h index aacec08f12..03c0db83c4 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_request.h @@ -53,7 +53,8 @@ class AlertManeuverRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - AlertManeuverRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + AlertManeuverRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief AlertManeuverRequest class destructor @@ -81,8 +82,8 @@ class AlertManeuverRequest : public CommandRequestImpl { */ bool IsWhiteSpaceExist(); - mobile_apis::Result::eType tts_speak_result_code_; - mobile_apis::Result::eType navi_alert_maneuver_result_code_; + mobile_apis::Result::eType tts_speak_result_code_; + mobile_apis::Result::eType navi_alert_maneuver_result_code_; Pending pending_requests_; DISALLOW_COPY_AND_ASSIGN(AlertManeuverRequest); diff --git a/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_response.h b/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_response.h index 4209edcf5e..c02322e298 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/alert_maneuver_response.h @@ -51,7 +51,8 @@ class AlertManeuverResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - AlertManeuverResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + AlertManeuverResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief AlertManeuverResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/alert_request.h b/src/components/application_manager/include/application_manager/commands/mobile/alert_request.h index 3061d87653..bc99665d82 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/alert_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/alert_request.h @@ -52,7 +52,8 @@ class AlertRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - AlertRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + AlertRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief AlertRequest class destructor @@ -71,7 +72,8 @@ class AlertRequest : public CommandRequestImpl { /* * @brief Will caled by request controller, when default will be expired. - * If Alert request has soft buttons, timeout response should not be sent to mobile + * If Alert request has soft buttons, timeout response should not be sent to + * mobile */ virtual void onTimeOut(); @@ -83,7 +85,6 @@ class AlertRequest : public CommandRequestImpl { void on_event(const event_engine::Event& event); protected: - private: /* * @brief Checks if request parameters are valid @@ -109,7 +110,8 @@ class AlertRequest : public CommandRequestImpl { * @param length_tts_chunks contains length of array * tts chunks. */ - void SendSpeakRequest(int32_t app_id, bool tts_chunks_exists, + void SendSpeakRequest(int32_t app_id, + bool tts_chunks_exists, size_t length_tts_chunks); /* @@ -124,14 +126,14 @@ class AlertRequest : public CommandRequestImpl { */ bool CheckStringsOfAlertRequest(); - bool awaiting_ui_alert_response_; - bool awaiting_tts_speak_response_; - bool awaiting_tts_stop_speaking_response_; - bool is_alert_succeeded_; - bool is_ui_alert_sent_; - mobile_apis::Result::eType alert_result_; - smart_objects::SmartObject alert_response_params_; - mobile_apis::Result::eType tts_speak_result_; + bool awaiting_ui_alert_response_; + bool awaiting_tts_speak_response_; + bool awaiting_tts_stop_speaking_response_; + bool is_alert_succeeded_; + bool is_ui_alert_sent_; + mobile_apis::Result::eType alert_result_; + smart_objects::SmartObject alert_response_params_; + mobile_apis::Result::eType tts_speak_result_; DISALLOW_COPY_AND_ASSIGN(AlertRequest); }; diff --git a/src/components/application_manager/include/application_manager/commands/mobile/alert_response.h b/src/components/application_manager/include/application_manager/commands/mobile/alert_response.h index a874a67aae..acac21d738 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/alert_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/alert_response.h @@ -51,7 +51,8 @@ class AlertResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - AlertResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + AlertResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief AlertResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/change_registration_request.h b/src/components/application_manager/include/application_manager/commands/mobile/change_registration_request.h index a83fbd7e5c..c81ed0b5d3 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/change_registration_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/change_registration_request.h @@ -57,7 +57,8 @@ class ChangeRegistrationRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - ChangeRegistrationRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + ChangeRegistrationRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief ChangeRegistrationRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/change_registration_response.h b/src/components/application_manager/include/application_manager/commands/mobile/change_registration_response.h index 247fb0192c..6ff3fd9a4a 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/change_registration_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/change_registration_response.h @@ -51,7 +51,8 @@ class ChangeRegistrationResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - ChangeRegistrationResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + ChangeRegistrationResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief ChangeRegistrationResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_request.h b/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_request.h index c77ffc3203..2a6e55f312 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_request.h @@ -53,186 +53,185 @@ namespace commands { **/ class CreateInteractionChoiceSetRequest : public CommandRequestImpl { public: - /** - * @brief CreateInteractionChoiceSetRequest class constructor - * - * @param message Incoming SmartObject message - **/ - CreateInteractionChoiceSetRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); - - /** - * @brief CreateInteractionChoiceSetRequest class destructor - **/ - virtual ~CreateInteractionChoiceSetRequest(); - - /** - * @brief Execute command - **/ - virtual void Run(); - + /** + * @brief CreateInteractionChoiceSetRequest class constructor + * + * @param message Incoming SmartObject message + **/ + CreateInteractionChoiceSetRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); + + /** + * @brief CreateInteractionChoiceSetRequest class destructor + **/ + virtual ~CreateInteractionChoiceSetRequest(); + + /** + * @brief Execute command + **/ + virtual void Run(); private: - /** - * @brief Interface method that is called whenever new event received - * - * @param event The received event - */ - virtual void on_event(const event_engine::Event& event); - - /** - * @brief Function is called by RequestController when request execution time - * has exceed it's limit - */ - virtual void onTimeOut(); - /** - * @brief DeleteChoices allows to walk through the sent commands collection - * in order to sent appropriate DeleteCommand request. - */ - void DeleteChoices(); - - /** - * @brief Calls after all responses from HMI were received. - * Terminates request and sends successful response to mobile - * if all responses were SUCCESS or calls DeleteChoices in other case. - */ - void OnAllHMIResponsesReceived(); - - /** - * @brief The VRCommand struct - * Collect minimum information about sent VR commands, for correctly - * processing deleting sent commands if error from HMI received - */ - struct VRCommandInfo { - VRCommandInfo() {} - VRCommandInfo(uint32_t cmd_id): - cmd_id_(cmd_id), - succesful_response_received_(false) {} - uint32_t cmd_id_; - bool succesful_response_received_; - }; - - typedef std::map<uint32_t, VRCommandInfo> SentCommandsMap; - SentCommandsMap sent_commands_map_; - - int32_t choice_set_id_; - size_t expected_chs_count_; - size_t received_chs_count_; - - /** - * @brief Flag for stop sending VR commands to HMI, in case one of responses - * failed - */ - volatile bool error_from_hmi_; - sync_primitives::Lock error_from_hmi_lock_; - - /** - * @brief Flag shows if request already was expired by timeout - */ - volatile bool is_timed_out_; - sync_primitives::Lock is_timed_out_lock_; - - sync_primitives::Lock vr_commands_lock_; - /* - * @brief Sends VR AddCommand request to HMI - * - * @param app_id Application ID - * - */ - void SendVRAddCommandRequests(ApplicationSharedPtr const app); - - /* - * @brief Checks incoming choiseSet params. - * @param app Registred mobile application - * - * @return Mobile result code - */ - mobile_apis::Result::eType CheckChoiceSet(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 - */ - struct CoincidencePredicateChoiceID { - CoincidencePredicateChoiceID(const uint32_t newItem) - : newItem_(newItem) - {} - - bool operator()(smart_objects::SmartObject obj) { - return obj[strings::choice_id].asUInt() == newItem_; - } - - const uint32_t newItem_; - }; - - /* - * @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) - {}; - - bool operator()(smart_objects::SmartObject obj) { - return obj[strings::menu_name].asString() == newItem_; - } - - const std::string& newItem_; - }; - - /* - * @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) {} - - bool operator()(smart_objects::SmartObject obj) { - return compareStr(obj, newItem_); - } - - const smart_objects::SmartObject& newItem_; - }; - - /* - * @brief Checks if incoming choice set doesn't has similar VR synonyms. - * - * @param choice1 Choice to compare - * @param choice2 Choice to compare - * - * return Return TRUE if there are similar VR synonyms in choice set, - * otherwise FALSE - */ - bool compareSynonyms( + /** + * @brief Interface method that is called whenever new event received + * + * @param event The received event + */ + virtual void on_event(const event_engine::Event& event); + + /** + * @brief Function is called by RequestController when request execution time + * has exceed it's limit + */ + virtual void onTimeOut(); + /** + * @brief DeleteChoices allows to walk through the sent commands collection + * in order to sent appropriate DeleteCommand request. + */ + void DeleteChoices(); + + /** + * @brief Calls after all responses from HMI were received. + * Terminates request and sends successful response to mobile + * if all responses were SUCCESS or calls DeleteChoices in other case. + */ + void OnAllHMIResponsesReceived(); + + /** + * @brief The VRCommand struct + * Collect minimum information about sent VR commands, for correctly + * processing deleting sent commands if error from HMI received + */ + struct VRCommandInfo { + VRCommandInfo() {} + VRCommandInfo(uint32_t cmd_id) + : cmd_id_(cmd_id), succesful_response_received_(false) {} + uint32_t cmd_id_; + bool succesful_response_received_; + }; + + typedef std::map<uint32_t, VRCommandInfo> SentCommandsMap; + SentCommandsMap sent_commands_map_; + + int32_t choice_set_id_; + size_t expected_chs_count_; + size_t received_chs_count_; + + /** + * @brief Flag for stop sending VR commands to HMI, in case one of responses + * failed + */ + volatile bool error_from_hmi_; + sync_primitives::Lock error_from_hmi_lock_; + + /** + * @brief Flag shows if request already was expired by timeout + */ + volatile bool is_timed_out_; + sync_primitives::Lock is_timed_out_lock_; + + sync_primitives::Lock vr_commands_lock_; + /* + * @brief Sends VR AddCommand request to HMI + * + * @param app_id Application ID + * + */ + void SendVRAddCommandRequests(ApplicationSharedPtr const app); + + /* + * @brief Checks incoming choiseSet params. + * @param app Registred mobile application + * + * @return Mobile result code + */ + mobile_apis::Result::eType CheckChoiceSet(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 + */ + struct CoincidencePredicateChoiceID { + CoincidencePredicateChoiceID(const uint32_t newItem) : newItem_(newItem) {} + + bool operator()(smart_objects::SmartObject obj) { + return obj[strings::choice_id].asUInt() == newItem_; + } + + const uint32_t newItem_; + }; + + /* + * @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){}; + + bool operator()(smart_objects::SmartObject obj) { + return obj[strings::menu_name].asString() == newItem_; + } + + const std::string& newItem_; + }; + + /* + * @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) {} + + bool operator()(smart_objects::SmartObject obj) { + return compareStr(obj, newItem_); + } + + const smart_objects::SmartObject& newItem_; + }; + + /* + * @brief Checks if incoming choice set doesn't has similar VR synonyms. + * + * @param choice1 Choice to compare + * @param choice2 Choice to compare + * + * return Return TRUE if there are similar VR synonyms in choice set, + * otherwise FALSE + */ + bool compareSynonyms( const NsSmartDeviceLink::NsSmartObjects::SmartObject& choice1, const NsSmartDeviceLink::NsSmartObjects::SmartObject& choice2); - /* - * @brief Checks VR synonyms ignoring differences in case. - * - * @param str1 VR synonym to compare - * @param str2 VR synonym to compare - * - * return Return TRUE if there are similar VR synonyms in choice set, - * otherwise FALSE - */ - static bool compareStr( + /* + * @brief Checks VR synonyms ignoring differences in case. + * + * @param str1 VR synonym to compare + * @param str2 VR synonym to compare + * + * return Return TRUE if there are similar VR synonyms in choice set, + * otherwise FALSE + */ + static bool compareStr( const NsSmartDeviceLink::NsSmartObjects::SmartObject& str1, const NsSmartDeviceLink::NsSmartObjects::SmartObject& str2); - /** - * @brief Checks choice set params(menuName, tertiaryText, ...) - * When type is String there is a check on the contents \t\n \\t \\n - * @param choice_set which must check - * @return if choice_set contains \t\n \\t \\n return TRUE, FALSE otherwise - */ - bool IsWhiteSpaceExist(const smart_objects::SmartObject& choice_set); + /** + * @brief Checks choice set params(menuName, tertiaryText, ...) + * When type is String there is a check on the contents \t\n \\t \\n + * @param choice_set which must check + * @return if choice_set contains \t\n \\t \\n return TRUE, FALSE otherwise + */ + bool IsWhiteSpaceExist(const smart_objects::SmartObject& choice_set); - DISALLOW_COPY_AND_ASSIGN(CreateInteractionChoiceSetRequest); + DISALLOW_COPY_AND_ASSIGN(CreateInteractionChoiceSetRequest); }; } // namespace commands diff --git a/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_response.h b/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_response.h index 589402209b..6a7faf705c 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/create_interaction_choice_set_response.h @@ -51,7 +51,8 @@ class CreateInteractionChoiceSetResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - CreateInteractionChoiceSetResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + CreateInteractionChoiceSetResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief CreateInteractionChoiceSetResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_command_request.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_command_request.h index 6961911889..6a19014c96 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/delete_command_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/delete_command_request.h @@ -51,7 +51,8 @@ class DeleteCommandRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - DeleteCommandRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + DeleteCommandRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief DeleteCommandRequest class destructor @@ -71,7 +72,6 @@ class DeleteCommandRequest : public CommandRequestImpl { void on_event(const event_engine::Event& event); private: - DISALLOW_COPY_AND_ASSIGN(DeleteCommandRequest); /* diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_command_response.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_command_response.h index 0780f81255..b61035ca1b 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/delete_command_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/delete_command_response.h @@ -51,7 +51,8 @@ class DeleteCommandResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - DeleteCommandResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + DeleteCommandResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief DeleteCommandResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_file_request.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_file_request.h index 2b74ee150b..adaf2686bc 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/delete_file_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/delete_file_request.h @@ -53,7 +53,8 @@ class DeleteFileRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - DeleteFileRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + DeleteFileRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief DeleteFileRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_file_response.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_file_response.h index c7ec60e3ba..e001e46a22 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/delete_file_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/delete_file_response.h @@ -51,7 +51,8 @@ class DeleteFileResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - DeleteFileResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + DeleteFileResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief DeleteFileResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h index 0eee4e8dc9..716a1d82de 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_request.h @@ -52,7 +52,8 @@ class DeleteInteractionChoiceSetRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - DeleteInteractionChoiceSetRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + DeleteInteractionChoiceSetRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief DeleteInteractionChoiceSetRequest class destructor @@ -65,7 +66,6 @@ class DeleteInteractionChoiceSetRequest : public CommandRequestImpl { virtual void Run(); private: - /* * @brief Check if requested choice set ID in use by perform interaction * diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_response.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_response.h index 1888f1d4a3..86e20bc6d4 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/delete_interaction_choice_set_response.h @@ -51,7 +51,8 @@ class DeleteInteractionChoiceSetResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - DeleteInteractionChoiceSetResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + DeleteInteractionChoiceSetResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief DeleteInteractionChoiceSetResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_request.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_request.h index a6bb2f233d..7c48de5d8e 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_request.h @@ -52,7 +52,8 @@ class DeleteSubMenuRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - DeleteSubMenuRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + DeleteSubMenuRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief DeleteSubMenuRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_response.h b/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_response.h index 5d65685785..76232aee4b 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/delete_sub_menu_response.h @@ -51,7 +51,8 @@ class DeleteSubMenuResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - DeleteSubMenuResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + DeleteSubMenuResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief DeleteSubMenuResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_request.h b/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_request.h index 888d7d1ee8..34c8b0e872 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_request.h @@ -51,7 +51,8 @@ class DiagnosticMessageRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - DiagnosticMessageRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + DiagnosticMessageRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief DiagnosticMessageRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_response.h b/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_response.h index d24b3f4428..439f11a57e 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/diagnostic_message_response.h @@ -51,7 +51,8 @@ class DiagnosticMessageResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - DiagnosticMessageResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + DiagnosticMessageResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief DiagnosticMessageResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/dial_number_request.h b/src/components/application_manager/include/application_manager/commands/mobile/dial_number_request.h index 700e01b484..1b945fc5fb 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/dial_number_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/dial_number_request.h @@ -48,7 +48,8 @@ class DialNumberRequest : public CommandRequestImpl { /** * \brief DialNumberRequest class constructor **/ - DialNumberRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + DialNumberRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * \brief DialNumberRequest class destructor @@ -58,11 +59,11 @@ class DialNumberRequest : public CommandRequestImpl { /** * @brief Initialize request params **/ - bool Init() OVERRIDE; + bool Init() OVERRIDE; - /** - * @brief Execute command - **/ + /** + * @brief Execute command + **/ void Run() OVERRIDE; /** @@ -73,13 +74,12 @@ class DialNumberRequest : public CommandRequestImpl { void on_event(const event_engine::Event& event); private: - /** * @brief Removes from number param all characters * except the + character and digits. * */ - void StripNumberParam(std::string &number); + void StripNumberParam(std::string& number); DISALLOW_COPY_AND_ASSIGN(DialNumberRequest); }; diff --git a/src/components/application_manager/include/application_manager/commands/mobile/dial_number_response.h b/src/components/application_manager/include/application_manager/commands/mobile/dial_number_response.h index fcb6bf865b..4a6980bd04 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/dial_number_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/dial_number_response.h @@ -51,7 +51,8 @@ class DialNumberResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - DialNumberResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + DialNumberResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief DialNumberResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_request.h b/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_request.h index cc01b9c176..add6d2497e 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_request.h @@ -51,7 +51,8 @@ class EndAudioPassThruRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - EndAudioPassThruRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + EndAudioPassThruRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief EndAudioPassThruRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_response.h b/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_response.h index 124361f0d5..381a397fbd 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/end_audio_pass_thru_response.h @@ -51,7 +51,8 @@ class EndAudioPassThruResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - EndAudioPassThruResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + EndAudioPassThruResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief EndAudioPassThruResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/generic_response.h b/src/components/application_manager/include/application_manager/commands/mobile/generic_response.h index 8eb257c356..9ccef12152 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/generic_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/generic_response.h @@ -45,15 +45,14 @@ class GenericResponse : public CommandResponseImpl { /** * \brief GenericResponse class constructor **/ - GenericResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { - } + GenericResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : CommandResponseImpl(message, application_manager) {} /** * \brief GenericResponse class destructor **/ - virtual ~GenericResponse() { - } + virtual ~GenericResponse() {} /** * @brief Execute command diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_request.h b/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_request.h index af3958699a..d962937e39 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_request.h @@ -51,7 +51,8 @@ class GetDTCsRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - GetDTCsRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + GetDTCsRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief GetDTCsRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_response.h b/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_response.h index ed3600da3e..abe970d60f 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/get_dtcs_response.h @@ -51,7 +51,8 @@ class GetDTCsResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - GetDTCsResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + GetDTCsResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief GetDTCsResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_request.h b/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_request.h index 9fd8c9ddbe..eda77e59b0 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_request.h @@ -53,7 +53,8 @@ class GetVehicleDataRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - GetVehicleDataRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + GetVehicleDataRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief GetVehicleDataRequest class destructor @@ -65,7 +66,6 @@ class GetVehicleDataRequest : public CommandRequestImpl { **/ virtual void Run(); - protected: virtual void on_event(const event_engine::Event& event); @@ -83,7 +83,7 @@ class GetVehicleDataRequest : public CommandRequestImpl { typedef std::vector<HmiRequest> HmiRequests; HmiRequests hmi_requests_; -#endif // #ifdef HMI_DBUS_API +#endif // #ifdef HMI_DBUS_API DISALLOW_COPY_AND_ASSIGN(GetVehicleDataRequest); }; diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_response.h b/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_response.h index 0a3d48a0e4..4fadaf2b01 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/get_vehicle_data_response.h @@ -51,7 +51,8 @@ class GetVehicleDataResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - GetVehicleDataResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + GetVehicleDataResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief GetVehicleDataResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_way_points_request.h b/src/components/application_manager/include/application_manager/commands/mobile/get_way_points_request.h index 5d77949352..bf23121177 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/get_way_points_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/get_way_points_request.h @@ -43,7 +43,7 @@ namespace commands { * @brief GetWayPointsRequest command class **/ class GetWayPointsRequest : public CommandRequestImpl { -public: + public: /** * \brief GetWayPointsRequest class constructor **/ @@ -65,12 +65,13 @@ public: * @param event The received event */ virtual void on_event(const event_engine::Event& event); -private: + + private: DISALLOW_COPY_AND_ASSIGN(GetWayPointsRequest); }; -} // namespace commands +} // namespace commands -} // namespace application_manager +} // namespace application_manager -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_WAY_POINTS_REQUEST_H_ +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_WAY_POINTS_REQUEST_H_ diff --git a/src/components/application_manager/include/application_manager/commands/mobile/get_way_points_response.h b/src/components/application_manager/include/application_manager/commands/mobile/get_way_points_response.h index 51bfdb5f83..cb4f840763 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/get_way_points_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/get_way_points_response.h @@ -44,7 +44,7 @@ namespace commands { * @brief GetWayPointsResponse command class **/ class GetWayPointsResponse : public CommandResponseImpl { -public: + public: /** * \brief GetWayPointsResponse class constructor **/ @@ -60,12 +60,13 @@ public: * @brief Execute command **/ virtual void Run() OVERRIDE; -private: + + private: DISALLOW_COPY_AND_ASSIGN(GetWayPointsResponse); }; -} // namespace commands +} // namespace commands -} // namespace application_manager +} // namespace application_manager -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_WAY_POINTS_RESPONSE_H_ +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_GET_WAY_POINTS_RESPONSE_H_ diff --git a/src/components/application_manager/include/application_manager/commands/mobile/list_files_request.h b/src/components/application_manager/include/application_manager/commands/mobile/list_files_request.h index 7bfeb5ba3b..d8d28b7e9d 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/list_files_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/list_files_request.h @@ -51,7 +51,8 @@ class ListFilesRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - ListFilesRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + ListFilesRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief ListFilesRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/list_files_response.h b/src/components/application_manager/include/application_manager/commands/mobile/list_files_response.h index fade4cbc3b..a211ee5968 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/list_files_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/list_files_response.h @@ -51,7 +51,8 @@ class ListFilesResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - ListFilesResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + ListFilesResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief ListFilesResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_audio_pass_thru_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_audio_pass_thru_notification.h index 2db99f9984..b74d8fbe41 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/on_audio_pass_thru_notification.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/on_audio_pass_thru_notification.h @@ -42,7 +42,8 @@ namespace application_manager { namespace commands { /** - * @brief OnAudioPassThruNotification class used to send notification with binary data written from + * @brief OnAudioPassThruNotification class used to send notification with + *binary data written from * microphone to mobile device while PerformAudioPassThru is active. **/ class OnAudioPassThruNotification : public CommandNotificationImpl { @@ -52,7 +53,8 @@ class OnAudioPassThruNotification : public CommandNotificationImpl { * * @param message Incoming SmartObject message **/ - OnAudioPassThruNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnAudioPassThruNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnAudioPassThruNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_button_event_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_button_event_notification.h index 04b6fdc767..80355993e1 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/on_button_event_notification.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/on_button_event_notification.h @@ -55,7 +55,8 @@ class OnButtonEventNotification : public CommandNotificationImpl { * * @param message Incoming SmartObject message **/ - OnButtonEventNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnButtonEventNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnButtonEventNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_button_press_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_button_press_notification.h index 91f66b54b3..1443e58a70 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/on_button_press_notification.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/on_button_press_notification.h @@ -55,7 +55,8 @@ class OnButtonPressNotification : public CommandNotificationImpl { * * @param message Incoming SmartObject message **/ - OnButtonPressNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnButtonPressNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnButtonEventCommand class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_command_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_command_notification.h index c983555fa7..3f9a0ad6c2 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/on_command_notification.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/on_command_notification.h @@ -54,7 +54,8 @@ class OnCommandNotification : public CommandNotificationImpl { * * @param message Incoming SmartObject message **/ - OnCommandNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnCommandNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnCommandNotification class destructor @@ -65,6 +66,7 @@ class OnCommandNotification : public CommandNotificationImpl { * @brief Execute command **/ virtual void Run(); + private: DISALLOW_COPY_AND_ASSIGN(OnCommandNotification); }; diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_driver_distraction_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_driver_distraction_notification.h index 0408b2b918..ee3c19c707 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/on_driver_distraction_notification.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/on_driver_distraction_notification.h @@ -53,7 +53,8 @@ class OnDriverDistractionNotification : public CommandNotificationImpl { * * @param message Incoming SmartObject message **/ - OnDriverDistractionNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnDriverDistractionNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnDriverDistractionNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_hash_change_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_hash_change_notification.h index 779cc37364..9f9fad16d4 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/on_hash_change_notification.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/on_hash_change_notification.h @@ -52,7 +52,8 @@ class OnHashChangeNotification : public CommandNotificationImpl { * * @param message Incoming SmartObject message **/ - OnHashChangeNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnHashChangeNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnHashChangeNotification class destructor @@ -68,7 +69,7 @@ class OnHashChangeNotification : public CommandNotificationImpl { DISALLOW_COPY_AND_ASSIGN(OnHashChangeNotification); }; -} // namespace mobile +} // namespace mobile } // namespace commands } // namespace application_manager diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification.h index ea2b949048..a82182eea0 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification.h @@ -51,7 +51,8 @@ class OnHMIStatusNotification : public CommandNotificationImpl { * * @param message Incoming SmartObject message **/ - OnHMIStatusNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnHMIStatusNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnHMIStatusNotification class destructor @@ -63,7 +64,7 @@ class OnHMIStatusNotification : public CommandNotificationImpl { **/ virtual void Run(); -private: + private: DISALLOW_COPY_AND_ASSIGN(OnHMIStatusNotification); }; diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification_from_mobile.h b/src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification_from_mobile.h index 73700e52c3..878f4fa720 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification_from_mobile.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/on_hmi_status_notification_from_mobile.h @@ -46,8 +46,8 @@ namespace commands { /** * @brief OnHMIStatusNotificationFromMobile class **/ -class OnHMIStatusNotificationFromMobile : - public CommandNotificationFromMobileImpl { +class OnHMIStatusNotificationFromMobile + : public CommandNotificationFromMobileImpl { public: /** * @brief OnHMIStatusNotificationFromMobile class constructor @@ -55,7 +55,7 @@ class OnHMIStatusNotificationFromMobile : * @param message Incoming SmartObject message **/ OnHMIStatusNotificationFromMobile(const MessageSharedPtr& message, - ApplicationManager& application_manager); + ApplicationManager& application_manager); /** * @brief OnHMIStatusNotificationFromMobile class destructor @@ -67,7 +67,7 @@ class OnHMIStatusNotificationFromMobile : **/ virtual void Run(); -private: + private: DISALLOW_COPY_AND_ASSIGN(OnHMIStatusNotificationFromMobile); }; diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_keyboard_input_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_keyboard_input_notification.h index 77036e2856..911ca70cdf 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/on_keyboard_input_notification.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/on_keyboard_input_notification.h @@ -53,7 +53,8 @@ class OnKeyBoardInputNotification : public CommandNotificationImpl { * * @param message Incoming SmartObject message **/ - OnKeyBoardInputNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnKeyBoardInputNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnKeyBoardInputNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_language_change_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_language_change_notification.h index ac04a81801..c62652ff67 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/on_language_change_notification.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/on_language_change_notification.h @@ -51,7 +51,8 @@ class OnLanguageChangeNotification : public CommandNotificationImpl { * * @param message Incoming SmartObject message **/ - OnLanguageChangeNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnLanguageChangeNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnLanguageChangeNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_permissions_change_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_permissions_change_notification.h index 88a1443ffa..d5f7aa96b8 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/on_permissions_change_notification.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/on_permissions_change_notification.h @@ -51,7 +51,8 @@ class OnPermissionsChangeNotification : public CommandNotificationImpl { * * @param message Incoming SmartObject message **/ - OnPermissionsChangeNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnPermissionsChangeNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnPermissionsChangeNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_system_request_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_system_request_notification.h index e45b332386..54b23f6ba3 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/on_system_request_notification.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/on_system_request_notification.h @@ -34,7 +34,6 @@ #ifndef SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_SYSTEM_REQUEST_NOTIFICATION_H_ #define SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_SYSTEM_REQUEST_NOTIFICATION_H_ - #include "application_manager/commands/command_notification_impl.h" namespace application_manager { @@ -53,7 +52,8 @@ class OnSystemRequestNotification : public CommandNotificationImpl { * * @param message Incoming SmartObject message **/ - OnSystemRequestNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnSystemRequestNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnSystemRequestNotification class destructor @@ -64,7 +64,8 @@ class OnSystemRequestNotification : public CommandNotificationImpl { * @brief Execute command **/ virtual void Run(); - private: + + private: DISALLOW_COPY_AND_ASSIGN(OnSystemRequestNotification); }; diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_tbt_client_state_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_tbt_client_state_notification.h index b2aac1543b..e7b895dceb 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/on_tbt_client_state_notification.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/on_tbt_client_state_notification.h @@ -51,7 +51,8 @@ class OnTBTClientStateNotification : public CommandNotificationImpl { * * @param message Incoming SmartObject message **/ - OnTBTClientStateNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnTBTClientStateNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnTBTClientStateNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_touch_event_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_touch_event_notification.h index 29b89e2f3f..abbf6787db 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/on_touch_event_notification.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/on_touch_event_notification.h @@ -53,7 +53,8 @@ class OnTouchEventNotification : public CommandNotificationImpl { * * @param message Incoming SmartObject message **/ - OnTouchEventNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnTouchEventNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnTouchEventNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_vehicle_data_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_vehicle_data_notification.h index 1fea85c09d..de6172de64 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/on_vehicle_data_notification.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/on_vehicle_data_notification.h @@ -53,7 +53,8 @@ class OnVehicleDataNotification : public CommandNotificationImpl { * * @param message Incoming SmartObject message **/ - OnVehicleDataNotification(const MessageSharedPtr& message, ApplicationManager& application_manager); + OnVehicleDataNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief OnVehicleDataNotification class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/on_way_point_change_notification.h b/src/components/application_manager/include/application_manager/commands/mobile/on_way_point_change_notification.h index c48458b8bc..c204e1669c 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/on_way_point_change_notification.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/on_way_point_change_notification.h @@ -40,30 +40,30 @@ namespace application_manager { namespace commands { -class OnWayPointChangeNotification: public CommandNotificationImpl { +class OnWayPointChangeNotification : public CommandNotificationImpl { public: - /** - * @brief OnWayPointChangeNotification class constructor - * - * @param message Incoming SmartObject message - **/ - OnWayPointChangeNotification(const MessageSharedPtr& message, - ApplicationManager& application_manager); + /** + * @brief OnWayPointChangeNotification class constructor + * + * @param message Incoming SmartObject message + **/ + OnWayPointChangeNotification(const MessageSharedPtr& message, + ApplicationManager& application_manager); - /** - * @brief OnWayPointChangeNotification class destructor - **/ - virtual ~OnWayPointChangeNotification(); + /** + * @brief OnWayPointChangeNotification class destructor + **/ + virtual ~OnWayPointChangeNotification(); - /** - * @brief Execute command - **/ - virtual void Run() OVERRIDE; + /** + * @brief Execute command + **/ + virtual void Run() OVERRIDE; private: - DISALLOW_COPY_AND_ASSIGN(OnWayPointChangeNotification); + DISALLOW_COPY_AND_ASSIGN(OnWayPointChangeNotification); }; } // namespace commands } // namespace application_manager -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_WAY_POINT_CHANGE_NOTIFICATION_H_ +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_ON_WAY_POINT_CHANGE_NOTIFICATION_H_ diff --git a/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h b/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h index 2487c85381..b69cb969e1 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h @@ -52,7 +52,8 @@ class PerformAudioPassThruRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - PerformAudioPassThruRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + PerformAudioPassThruRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief PerformAudioPassThruRequest class destructor @@ -126,7 +127,7 @@ class PerformAudioPassThruRequest : public CommandRequestImpl { */ void FinishTTSSpeak(); - //flag display state of speak during perform audio pass thru + // flag display state of speak during perform audio pass thru bool is_active_tts_speak_; mobile_apis::Result::eType result_tts_speak_; diff --git a/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_response.h b/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_response.h index 97f46ff518..d227c4fef3 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_response.h @@ -51,7 +51,8 @@ class PerformAudioPassThruResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - PerformAudioPassThruResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + PerformAudioPassThruResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief PerformAudioPassThruResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_request.h b/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_request.h index 8eee969e86..f64b2ab334 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_request.h @@ -47,15 +47,15 @@ namespace commands { /** * @brief PerformInteractionRequest command class **/ -class PerformInteractionRequest : public CommandRequestImpl { - +class PerformInteractionRequest : public CommandRequestImpl { public: /** * @brief PerformInteractionRequest class constructor * * @param message Incoming SmartObject message **/ - PerformInteractionRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + PerformInteractionRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief PerformInteractionRequest class destructor @@ -85,7 +85,7 @@ class PerformInteractionRequest : public CommandRequestImpl { * has exceed it's limit * */ - virtual void onTimeOut(); + virtual void onTimeOut(); /* * @brief Function will be called when VR_OnCommand event @@ -94,7 +94,8 @@ class PerformInteractionRequest : public CommandRequestImpl { * @param message which should send to mobile side * */ - void ProcessVRResponse(const smart_objects::SmartObject& message, smart_objects::SmartObject& msg_params); + void ProcessVRResponse(const smart_objects::SmartObject& message, + smart_objects::SmartObject& msg_params); /* * @brief Sends PerformInteraction response to mobile side @@ -102,9 +103,9 @@ class PerformInteractionRequest : public CommandRequestImpl { * @param message which should send to mobile side * */ - void ProcessPerformInteractionResponse - (const smart_objects::SmartObject& message, smart_objects::SmartObject &msg_params); - + void ProcessPerformInteractionResponse( + const smart_objects::SmartObject& message, + smart_objects::SmartObject& msg_params); /* * @brief Sends UI PerformInteraction request to HMI @@ -139,7 +140,8 @@ class PerformInteractionRequest : public CommandRequestImpl { * return Return TRUE if there are no similar menu names in choice set, * otherwise FALSE */ - bool CheckChoiceSetMenuNames(application_manager::ApplicationSharedPtr const app); + bool CheckChoiceSetMenuNames( + application_manager::ApplicationSharedPtr const app); /* * @brief Checks if incoming choice set doesn't has similar VR synonyms. @@ -149,7 +151,8 @@ class PerformInteractionRequest : public CommandRequestImpl { * return Return TRUE if there are no similar VR synonyms in choice set, * otherwise FALSE */ - bool CheckChoiceSetVRSynonyms(application_manager::ApplicationSharedPtr const app); + bool CheckChoiceSetVRSynonyms( + application_manager::ApplicationSharedPtr const app); /* * @brief Checks if request with non-sequential positions of vrHelpItems @@ -160,7 +163,8 @@ class PerformInteractionRequest : public CommandRequestImpl { * @return TRUE if vrHelpItems positions are sequential, * otherwise FALSE */ - bool CheckVrHelpItemPositions(application_manager::ApplicationSharedPtr const app); + bool CheckVrHelpItemPositions( + application_manager::ApplicationSharedPtr const app); /* * @brief Disable PerformInteraction state in application and @@ -201,9 +205,10 @@ class PerformInteractionRequest : public CommandRequestImpl { * same choice id returns false, otherwise returns * true. */ - bool CheckChoiceIDFromRequest(ApplicationSharedPtr app, - const size_t choice_set_id_list_length, - const smart_objects::SmartObject& choice_set_id_list) const; + bool CheckChoiceIDFromRequest( + ApplicationSharedPtr app, + const size_t choice_set_id_list_length, + const smart_objects::SmartObject& choice_set_id_list) const; /** * @brief Tells if there are sent requests without responses @@ -222,17 +227,17 @@ class PerformInteractionRequest : public CommandRequestImpl { * @brief Check UI & VR result codes, send response to mobile * @param msg_param Message params to send */ - void SendBothModeResponse(const smart_objects::SmartObject &msg_param); + void SendBothModeResponse(const smart_objects::SmartObject& msg_param); mobile_apis::InteractionMode::eType interaction_mode_; - bool ui_response_recived_; - bool vr_response_recived_; - bool ui_result_; - bool vr_result_; - bool app_pi_was_active_before_; - static uint32_t pi_requests_count_; - mobile_apis::Result::eType vr_resultCode_; - mobile_apis::Result::eType ui_resultCode_; + bool ui_response_recived_; + bool vr_response_recived_; + bool ui_result_; + bool vr_result_; + bool app_pi_was_active_before_; + static uint32_t pi_requests_count_; + mobile_apis::Result::eType vr_resultCode_; + mobile_apis::Result::eType ui_resultCode_; DISALLOW_COPY_AND_ASSIGN(PerformInteractionRequest); }; diff --git a/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_response.h b/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_response.h index f1801486f1..1274996747 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/perform_interaction_response.h @@ -51,7 +51,8 @@ class PerformInteractionResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - PerformInteractionResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + PerformInteractionResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief PerformInteractionResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/put_file_request.h b/src/components/application_manager/include/application_manager/commands/mobile/put_file_request.h index 78f2d9cb94..e3af8ac69b 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/put_file_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/put_file_request.h @@ -52,7 +52,8 @@ class PutFileRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - PutFileRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + PutFileRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief PutFileRequest class destructor @@ -65,13 +66,13 @@ class PutFileRequest : public CommandRequestImpl { virtual void Run(); private: - int64_t offset_; - std::string sync_file_name_; - int64_t length_; - mobile_apis::FileType::eType file_type_; - bool is_persistent_file_; + int64_t offset_; + std::string sync_file_name_; + int64_t length_; + mobile_apis::FileType::eType file_type_; + bool is_persistent_file_; - void SendOnPutFileNotification(); + void SendOnPutFileNotification(); DISALLOW_COPY_AND_ASSIGN(PutFileRequest); }; diff --git a/src/components/application_manager/include/application_manager/commands/mobile/put_file_response.h b/src/components/application_manager/include/application_manager/commands/mobile/put_file_response.h index 2b603579a6..f561f9fdbc 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/put_file_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/put_file_response.h @@ -51,7 +51,8 @@ class PutFileResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - PutFileResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + PutFileResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief PutFileResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/read_did_request.h b/src/components/application_manager/include/application_manager/commands/mobile/read_did_request.h index 7325f5ee3e..c88f16dab0 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/read_did_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/read_did_request.h @@ -51,7 +51,8 @@ class ReadDIDRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - ReadDIDRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + ReadDIDRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief ReadDIDRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/read_did_response.h b/src/components/application_manager/include/application_manager/commands/mobile/read_did_response.h index 137d73f220..2e493fa0ec 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/read_did_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/read_did_response.h @@ -51,7 +51,8 @@ class ReadDIDResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - ReadDIDResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + ReadDIDResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief ReadDIDResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_request.h b/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_request.h index 7b20a59f93..7c766a94af 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_request.h @@ -60,7 +60,7 @@ class RegisterAppInterfaceRequest : public CommandRequestImpl { * \brief RegisterAppInterfaceRequest class constructor **/ RegisterAppInterfaceRequest(const MessageSharedPtr& message, - ApplicationManager& application_manager); + ApplicationManager& application_manager); /** * @brief RegisterAppInterfaceRequest class destructor @@ -119,7 +119,7 @@ class RegisterAppInterfaceRequest : public CommandRequestImpl { */ struct CoincidencePredicateVR { CoincidencePredicateVR(const custom_str::CustomString& newItem) - : newItem_(newItem){} + : newItem_(newItem) {} bool operator()(const smart_objects::SmartObject& obj) { const custom_str::CustomString& vr_synonym = obj.asCustomString(); @@ -168,7 +168,7 @@ class RegisterAppInterfaceRequest : public CommandRequestImpl { std::string response_info_; mobile_apis::Result::eType result_checking_app_hmi_type_; - policy::PolicyHandlerInterface &GetPolicyHandler(); + policy::PolicyHandlerInterface& GetPolicyHandler(); DISALLOW_COPY_AND_ASSIGN(RegisterAppInterfaceRequest); }; diff --git a/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_response.h b/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_response.h index befd17256a..b125cc7c55 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/register_app_interface_response.h @@ -48,14 +48,13 @@ class RegisterAppInterfaceResponse : public CommandResponseImpl { * \brief RegisterAppInterfaceResponse class constructor **/ RegisterAppInterfaceResponse(const MessageSharedPtr& response, - ApplicationManager& application_manager) + ApplicationManager& application_manager) : CommandResponseImpl(response, application_manager) {} /** * \brief RegisterAppInterfaceResponse class destructor **/ - virtual ~RegisterAppInterfaceResponse() { - } + virtual ~RegisterAppInterfaceResponse() {} /** * @brief Execute command diff --git a/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_request.h b/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_request.h index 4b6864f057..0053c14f3c 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_request.h @@ -52,7 +52,8 @@ class ResetGlobalPropertiesRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - ResetGlobalPropertiesRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + ResetGlobalPropertiesRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief ResetGlobalPropertiesRequest class destructor @@ -103,7 +104,8 @@ class ResetGlobalPropertiesRequest : public CommandRequestImpl { * * @return TRUE on success, otherwise FALSE */ - bool ResetVrHelpTitleItems(application_manager::ApplicationSharedPtr const app); + bool ResetVrHelpTitleItems( + application_manager::ApplicationSharedPtr const app); /* * @brief Check if there some not delivered hmi responses exist diff --git a/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_response.h b/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_response.h index 9630d7f105..39e28486d4 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/reset_global_properties_response.h @@ -51,7 +51,8 @@ class ResetGlobalPropertiesResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - ResetGlobalPropertiesResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + ResetGlobalPropertiesResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief ResetGlobalPropertiesResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_request.h b/src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_request.h index 7740447f1d..b3058c9a26 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_request.h @@ -50,7 +50,8 @@ class ScrollableMessageRequest : public CommandRequestImpl { /** * @brief ScrollableMessageRequest class constructor **/ - ScrollableMessageRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + ScrollableMessageRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief SliderCommand class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_response.h b/src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_response.h index 7a8c9eec14..aa0ac01e9d 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/scrollable_message_response.h @@ -45,13 +45,13 @@ class ScrollableMessageResponse : public CommandResponseImpl { /** * \brief ScrollableMessageResponse class constructor **/ - ScrollableMessageResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + ScrollableMessageResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * \brief SpeakResponseCommand class destructor **/ - virtual ~ScrollableMessageResponse() { - } + virtual ~ScrollableMessageResponse() {} /** * @brief Execute command diff --git a/src/components/application_manager/include/application_manager/commands/mobile/send_location_request.h b/src/components/application_manager/include/application_manager/commands/mobile/send_location_request.h index ccb494d432..9cc1a4fd83 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/send_location_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/send_location_request.h @@ -49,7 +49,8 @@ class SendLocationRequest : public CommandRequestImpl { /** * @brief SendLocationRquest class constructor */ - SendLocationRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + SendLocationRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief SendLocationRquest class destructor @@ -68,13 +69,12 @@ class SendLocationRequest : public CommandRequestImpl { */ virtual void on_event(const event_engine::Event& event); - 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(); /** @@ -84,7 +84,8 @@ class SendLocationRequest : public CommandRequestImpl { */ bool IsWhiteSpaceExist(); - bool CheckHMICapabilities(std::list<hmi_apis::Common_TextFieldName::eType>& fields_names); + bool CheckHMICapabilities( + std::list<hmi_apis::Common_TextFieldName::eType>& fields_names); DISALLOW_COPY_AND_ASSIGN(SendLocationRequest); }; diff --git a/src/components/application_manager/include/application_manager/commands/mobile/send_location_response.h b/src/components/application_manager/include/application_manager/commands/mobile/send_location_response.h index 84a30c4029..0be0be8ca3 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/send_location_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/send_location_response.h @@ -36,7 +36,6 @@ #include "application_manager/commands/command_response_impl.h" #include "application_manager/message.h" - namespace application_manager { namespace commands { @@ -45,7 +44,8 @@ class SendLocationResponse : public CommandResponseImpl { /** * @brief SendLocationResponse class constructor */ - SendLocationResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + SendLocationResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief SendLocationResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_request.h b/src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_request.h index 91cd842982..42eedad19b 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_request.h @@ -49,17 +49,15 @@ class SetAppIconRequest : public CommandRequestImpl { /** * @brief Contains information about the type of image */ - typedef enum { - STATIC = 0, - DYNAMIC - } ImageType; + typedef enum { STATIC = 0, DYNAMIC } ImageType; /** * @brief SetIconRequest class constructor * * @param message Incoming SmartObject message **/ - SetAppIconRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + SetAppIconRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief SetIconRequest class destructor @@ -101,7 +99,7 @@ class SetAppIconRequest : public CommandRequestImpl { bool IsEnoughSpaceForIcon(const uint64_t icon_size) const; DISALLOW_COPY_AND_ASSIGN(SetAppIconRequest); -private: + private: /** * @brief Checks, if icons saving to configured folder is enabled */ diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_response.h b/src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_response.h index af5b9b69db..6061cf5702 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/set_app_icon_response.h @@ -51,7 +51,8 @@ class SetAppIconResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - SetAppIconResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + SetAppIconResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief SetIconResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_request.h b/src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_request.h index d847420b16..06e8d70f79 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_request.h @@ -51,7 +51,8 @@ class SetDisplayLayoutRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - SetDisplayLayoutRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + SetDisplayLayoutRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief SetDisplayLayoutRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_response.h b/src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_response.h index 8b621ad9fe..a2040307b0 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/set_display_layout_response.h @@ -51,7 +51,8 @@ class SetDisplayLayoutResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - SetDisplayLayoutResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + SetDisplayLayoutResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief SetDisplayLayoutResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_request.h b/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_request.h index b6ecf53dc5..aa26a70393 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_request.h @@ -51,7 +51,8 @@ class SetGlobalPropertiesRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - SetGlobalPropertiesRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + SetGlobalPropertiesRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief SetGlobalPropertiesRequest class destructor @@ -72,22 +73,26 @@ class SetGlobalPropertiesRequest : public CommandRequestImpl { private: // Verify correctness VrHelptitle value - static bool ValidateVRHelpTitle(const smart_objects::SmartObject* const vr_help_so_ptr); + static bool ValidateVRHelpTitle( + const smart_objects::SmartObject* const vr_help_so_ptr); // prepare UI sending data (VrHelps, Menus, Keyboard) to SmartObject - static void PrepareUIRequestVRHelpData(const ApplicationSharedPtr app, - const smart_objects::SmartObject& msg_params, - smart_objects::SmartObject& out_params); + static void PrepareUIRequestVRHelpData( + const ApplicationSharedPtr app, + const smart_objects::SmartObject& msg_params, + smart_objects::SmartObject& out_params); - static bool PrepareUIRequestDefaultVRHelpData(const ApplicationSharedPtr app, - smart_objects::SmartObject& out_params); + static bool PrepareUIRequestDefaultVRHelpData( + const ApplicationSharedPtr app, smart_objects::SmartObject& out_params); - static void PrepareUIRequestMenuAndKeyboardData(const ApplicationSharedPtr app, - const smart_objects::SmartObject& msg_params, - smart_objects::SmartObject& out_params); + static void PrepareUIRequestMenuAndKeyboardData( + const ApplicationSharedPtr app, + const smart_objects::SmartObject& msg_params, + smart_objects::SmartObject& out_params); // Send TTS request to HMI - void SendTTSRequest(const smart_objects::SmartObject& params, bool use_events); + void SendTTSRequest(const smart_objects::SmartObject& params, + bool use_events); // Send UI request to HMI void SendUIRequest(const smart_objects::SmartObject& params, bool use_events); diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_response.h b/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_response.h index ca70397c81..c5beda084d 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/set_global_properties_response.h @@ -51,7 +51,8 @@ class SetGlobalPropertiesResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - SetGlobalPropertiesResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + SetGlobalPropertiesResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief SetGlobalPropertiesResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_icon_request.h b/src/components/application_manager/include/application_manager/commands/mobile/set_icon_request.h index d1866d4080..96d4ac6f1e 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/set_icon_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/set_icon_request.h @@ -50,17 +50,15 @@ class SetIconRequest : public CommandRequestImpl { /** * @brief Contains information about the type of image */ - typedef enum { - STATIC = 0, - DYNAMIC - } ImageType; + typedef enum { STATIC = 0, DYNAMIC } ImageType; /** * @brief SetIconRequest class constructor * * @param message Incoming SmartObject message **/ - SetIconRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + SetIconRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief SetIconRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_icon_response.h b/src/components/application_manager/include/application_manager/commands/mobile/set_icon_response.h index 4915664483..83be0d4a4b 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/set_icon_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/set_icon_response.h @@ -52,8 +52,7 @@ class SetIconResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - SetIconResponse(const MessageSharedPtr& message, - ApplicationManager& app_man); + SetIconResponse(const MessageSharedPtr& message, ApplicationManager& app_man); /** * @brief SetIconResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_request.h b/src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_request.h index ae25e2a9e4..283dd41622 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_request.h @@ -49,7 +49,8 @@ class SetMediaClockRequest : public CommandRequestImpl { /** * \brief SetMediaClockRequest class constructor **/ - SetMediaClockRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + SetMediaClockRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * \brief ShowCommand class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_response.h b/src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_response.h index 5641531391..3f41ae2dab 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/set_media_clock_timer_response.h @@ -45,7 +45,8 @@ class SetMediaClockTimerResponse : public CommandResponseImpl { /** * \brief SetMediaClockTimerResponse class constructor **/ - SetMediaClockTimerResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + SetMediaClockTimerResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * \brief SetMediaClockTimerResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_request.h b/src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_request.h index 279d031eaa..f015d740df 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_request.h @@ -52,7 +52,8 @@ class ShowConstantTBTRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - ShowConstantTBTRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + ShowConstantTBTRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief ShowConstantTBTRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_response.h b/src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_response.h index 82d19d6b49..73aad5de89 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/show_constant_tbt_response.h @@ -51,7 +51,8 @@ class ShowConstantTBTResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - ShowConstantTBTResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + ShowConstantTBTResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief ShowConstantTBTResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/show_request.h b/src/components/application_manager/include/application_manager/commands/mobile/show_request.h index 3a85d007ad..cbe2ca396a 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/show_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/show_request.h @@ -50,7 +50,8 @@ class ShowRequest : public CommandRequestImpl { /** * \brief ShowRequest class constructor **/ - ShowRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + ShowRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * \brief ShowRequest class destructor @@ -70,7 +71,6 @@ class ShowRequest : public CommandRequestImpl { virtual void on_event(const event_engine::Event& event); private: - /* * @brief Check if all strings have valid syntax in request * diff --git a/src/components/application_manager/include/application_manager/commands/mobile/show_response.h b/src/components/application_manager/include/application_manager/commands/mobile/show_response.h index 3f13fc8dd1..0a54fb9cde 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/show_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/show_response.h @@ -45,7 +45,8 @@ class ShowResponse : public CommandResponseImpl { /** * \brief ShowResponse class constructor **/ - ShowResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + ShowResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * \brief ShowResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/slider_request.h b/src/components/application_manager/include/application_manager/commands/mobile/slider_request.h index 5231623c19..2446c9ff20 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/slider_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/slider_request.h @@ -49,7 +49,8 @@ class SliderRequest : public CommandRequestImpl { /** * \brief SliderRequest class constructor **/ - SliderRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + SliderRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * \brief SliderRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/slider_response.h b/src/components/application_manager/include/application_manager/commands/mobile/slider_response.h index aca486ea40..bc0efaadd0 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/slider_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/slider_response.h @@ -45,7 +45,8 @@ class SliderResponse : public CommandResponseImpl { /** * \brief SliderResponse class constructor **/ - SliderResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + SliderResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * \brief SpeakResponseCommand class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/speak_request.h b/src/components/application_manager/include/application_manager/commands/mobile/speak_request.h index 8147a871fe..dc22652b27 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/speak_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/speak_request.h @@ -49,7 +49,8 @@ class SpeakRequest : public CommandRequestImpl { /** * \brief SpeakRequest class constructor **/ - SpeakRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + SpeakRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * \brief SpeakRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/speak_response.h b/src/components/application_manager/include/application_manager/commands/mobile/speak_response.h index c2d0bff9af..2808526603 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/speak_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/speak_response.h @@ -45,7 +45,8 @@ class SpeakResponse : public CommandResponseImpl { /** * \brief SpeakResponse class constructor **/ - SpeakResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + SpeakResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * \brief SpeakResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_request.h b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_request.h index 44d2509e70..b5a22d40a9 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_request.h @@ -52,7 +52,8 @@ class SubscribeButtonRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - SubscribeButtonRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + SubscribeButtonRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief SubscribeButtonRequest class destructor @@ -65,7 +66,6 @@ class SubscribeButtonRequest : public CommandRequestImpl { virtual void Run(); private: - /** * @brief Checks if button subscription allowed. In case non-media * application trying to subscribe on buttons(tune, seek) negative result will diff --git a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_response.h b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_response.h index 8b7651b426..38e0dd2dc6 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_button_response.h @@ -51,7 +51,8 @@ class SubscribeButtonResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - SubscribeButtonResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + SubscribeButtonResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief SubscribeButtonResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h index bd11b1772b..6b2c2bb616 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_request.h @@ -52,7 +52,8 @@ class SubscribeVehicleDataRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - SubscribeVehicleDataRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + SubscribeVehicleDataRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief SubscribeButtonCommandRequest class destructor @@ -83,7 +84,7 @@ class SubscribeVehicleDataRequest : public CommandRequestImpl { typedef std::vector<HmiRequest> HmiRequests; HmiRequests hmi_requests_; -#endif // #ifdef HMI_DBUS_API +#endif // #ifdef HMI_DBUS_API private: /** diff --git a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_response.h b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_response.h index ac188be74d..7e3cffc387 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_vehicle_data_response.h @@ -51,7 +51,8 @@ class SubscribeVehicleDataResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - SubscribeVehicleDataResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + SubscribeVehicleDataResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UnsubscribeVehicleDataCommandRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_request.h b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_request.h index 166835c1ce..50b3a6f2cb 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_request.h @@ -43,7 +43,7 @@ namespace commands { * @brief SubsribeWayPointsRequest command class **/ class SubscribeWayPointsRequest : public CommandRequestImpl { -public: + public: /** * \brief SubscribeWayPointsRequest class constructor **/ @@ -65,12 +65,13 @@ public: * @param event The received event */ virtual void on_event(const event_engine::Event& event); -private: + + private: DISALLOW_COPY_AND_ASSIGN(SubscribeWayPointsRequest); }; -} // commands +} // commands -} // application_manager +} // application_manager -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_REQUEST_H_ +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_REQUEST_H_ diff --git a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_response.h b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_response.h index fc2a06ea69..cfdc0eede7 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/subscribe_way_points_response.h @@ -44,7 +44,7 @@ namespace commands { * @brief SubscribeWayPointsResponse command class **/ class SubscribeWayPointsResponse : public CommandResponseImpl { -public: + public: /** * \brief SubscribeWayPointsResponse class constructor **/ @@ -60,12 +60,13 @@ public: * @brief Execute command **/ virtual void Run() OVERRIDE; -private: + + private: DISALLOW_COPY_AND_ASSIGN(SubscribeWayPointsResponse); }; -} // commands +} // commands -} // application_manager +} // application_manager -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_RESPONSE_H_ +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_SUBSCRIBE_WAY_POINTS_RESPONSE_H_ diff --git a/src/components/application_manager/include/application_manager/commands/mobile/system_request.h b/src/components/application_manager/include/application_manager/commands/mobile/system_request.h index 013c74eb86..76447b4753 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/system_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/system_request.h @@ -60,7 +60,8 @@ class SystemRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - SystemRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + SystemRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief SystemRequest class destructor @@ -79,7 +80,7 @@ class SystemRequest : public CommandRequestImpl { */ virtual void on_event(const event_engine::Event& event); -private: + private: /** * @brief Validates data coming within QueryApps response * @param data Data @@ -89,7 +90,7 @@ private: private: static uint32_t index; - std::string processing_file_; + std::string processing_file_; DISALLOW_COPY_AND_ASSIGN(SystemRequest); }; diff --git a/src/components/application_manager/include/application_manager/commands/mobile/system_response.h b/src/components/application_manager/include/application_manager/commands/mobile/system_response.h index 09e8bf624f..3f48db7f0e 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/system_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/system_response.h @@ -36,7 +36,6 @@ #include "application_manager/commands/command_response_impl.h" - namespace application_manager { namespace commands { @@ -51,7 +50,8 @@ class SystemResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - SystemResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + SystemResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief SystemResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_request.h b/src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_request.h index a03dcef06f..acc7374e18 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_request.h @@ -49,15 +49,14 @@ class UnregisterAppInterfaceRequest : public CommandRequestImpl { /** * \brief UnregisterAppInterfaceRequest class constructor **/ - UnregisterAppInterfaceRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager) { - } + UnregisterAppInterfaceRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : CommandRequestImpl(message, application_manager) {} /** * \brief UnregisterAppInterfaceRequest class destructor **/ - virtual ~UnregisterAppInterfaceRequest() { - } + virtual ~UnregisterAppInterfaceRequest() {} /** * @brief Execute command diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_response.h b/src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_response.h index ba36342086..1a459e109c 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/unregister_app_interface_response.h @@ -47,15 +47,14 @@ class UnregisterAppInterfaceResponse : public CommandResponseImpl { /** * \brief UnregisterAppInterfaceResponse class constructor **/ - UnregisterAppInterfaceResponse( - const MessageSharedPtr& response, ApplicationManager& application_manager) + UnregisterAppInterfaceResponse(const MessageSharedPtr& response, + ApplicationManager& application_manager) : CommandResponseImpl(response, application_manager) {} /** * \brief UnregisterAppInterfaceResponse class destructor **/ - virtual ~UnregisterAppInterfaceResponse() { - } + virtual ~UnregisterAppInterfaceResponse() {} /** * @brief Execute command diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_request.h b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_request.h index 02610f813d..62600d51d7 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_request.h @@ -51,7 +51,8 @@ class UnsubscribeButtonRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - UnsubscribeButtonRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + UnsubscribeButtonRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UnsubscribeButtonRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_response.h b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_response.h index c8b8314017..06dbe84578 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_button_response.h @@ -51,7 +51,8 @@ class UnsubscribeButtonResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - UnsubscribeButtonResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + UnsubscribeButtonResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UnsubscribeButtonResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h index bd381ba85d..a6bade2fd6 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_request.h @@ -52,7 +52,8 @@ class UnsubscribeVehicleDataRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - UnsubscribeVehicleDataRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + UnsubscribeVehicleDataRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UnsubscribeVehicleDataRequest class destructor @@ -83,7 +84,7 @@ class UnsubscribeVehicleDataRequest : public CommandRequestImpl { typedef std::vector<HmiRequest> HmiRequests; HmiRequests hmi_requests_; -#endif // #ifdef HMI_DBUS_API +#endif // #ifdef HMI_DBUS_API private: /** diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_response.h b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_response.h index 7f29fd07f6..a34a36688c 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_vehicle_data_response.h @@ -51,7 +51,8 @@ class UnsubscribeVehicleDataResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - UnsubscribeVehicleDataResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + UnsubscribeVehicleDataResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UnsubscribeVehicleDataResponse class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_request.h b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_request.h index fc0cc7a982..2831551667 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_request.h @@ -40,7 +40,7 @@ namespace application_manager { namespace commands { class UnSubscribeWayPointsRequest : public CommandRequestImpl { -public: + public: /** * \brief UnSubscribeWayPointsRequest class constructor **/ @@ -62,12 +62,13 @@ public: * @param event The received event */ virtual void on_event(const event_engine::Event& event); -private: + + private: DISALLOW_COPY_AND_ASSIGN(UnSubscribeWayPointsRequest); }; -} // commands +} // commands -} // application_manager +} // application_manager -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_ +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_REQUEST_H_ diff --git a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_response.h b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_response.h index d8b46e4dda..70211330a9 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/unsubscribe_way_points_response.h @@ -44,7 +44,7 @@ namespace commands { * @brief UnsubscribeWayPointsResponse command class **/ class UnsubscribeWayPointsResponse : public CommandResponseImpl { -public: + public: /** * \brief UnsubscribeWayPointsResponse class constructor **/ @@ -60,12 +60,13 @@ public: * @brief Execute command **/ virtual void Run() OVERRIDE; -private: + + private: DISALLOW_COPY_AND_ASSIGN(UnsubscribeWayPointsResponse); }; -} // commands +} // commands -} // application_manager +} // application_manager -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_ +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_COMMANDS_MOBILE_UNSUBSCRIBE_WAY_POINTS_RESPONSE_H_ diff --git a/src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_request.h b/src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_request.h index ee68d9e3af..e15e81caf5 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_request.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_request.h @@ -52,7 +52,8 @@ class UpdateTurnListRequest : public CommandRequestImpl { * * @param message Incoming SmartObject message **/ - UpdateTurnListRequest(const MessageSharedPtr& message, ApplicationManager& application_manager); + UpdateTurnListRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UpdateTurnListRequest class destructor diff --git a/src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_response.h b/src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_response.h index 17f81d6742..481ad9f219 100644 --- a/src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_response.h +++ b/src/components/application_manager/include/application_manager/commands/mobile/update_turn_list_response.h @@ -51,7 +51,8 @@ class UpdateTurnListResponse : public CommandResponseImpl { * * @param message Incoming SmartObject message **/ - UpdateTurnListResponse(const MessageSharedPtr& message, ApplicationManager& application_manager); + UpdateTurnListResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager); /** * @brief UpdateTurnListResponse class destructor 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 7e90227bd7..4b8a4088bf 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 @@ -47,7 +47,6 @@ namespace smart_objects = NsSmartDeviceLink::NsSmartObjects; class Event { public: - // Typedef for possible Event ID's from mobile_apis functionID enum typedef hmi_apis::FunctionID::eType EventID; @@ -104,11 +103,9 @@ class Event { inline int32_t smart_object_type() const; protected: - private: - - EventID id_; - smart_objects::SmartObject response_so_; + EventID id_; + smart_objects::SmartObject response_so_; /* * @brief Default constructor @@ -129,18 +126,21 @@ const smart_objects::SmartObject& Event::smart_object() const { } int32_t Event::smart_object_function_id() const { - return response_so_.getElement( - strings::params).getElement(strings::function_id).asInt(); + return response_so_.getElement(strings::params) + .getElement(strings::function_id) + .asInt(); } int32_t Event::smart_object_correlation_id() const { - return response_so_.getElement( - strings::params).getElement(strings::correlation_id).asInt(); + return response_so_.getElement(strings::params) + .getElement(strings::correlation_id) + .asInt(); } int32_t Event::smart_object_type() const { - return response_so_.getElement( - strings::params).getElement(strings::message_type).asInt(); + return response_so_.getElement(strings::params) + .getElement(strings::message_type) + .asInt(); } } // namespace event_engine 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 89e1fd3daf..3d236b9c0f 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 @@ -43,7 +43,6 @@ class EventObserver; class EventDispatcher { public: - /* * @brief Delivers the event to all subscribers * @@ -59,8 +58,8 @@ class EventDispatcher { * @param observer The observer to subscribe for event */ virtual void add_observer(const Event::EventID& event_id, - int32_t hmi_correlation_id, - EventObserver& observer) = 0; + int32_t hmi_correlation_id, + EventObserver& observer) = 0; /* * @brief Unsubscribes the observer from specific event @@ -69,7 +68,7 @@ class EventDispatcher { * @param observer The observer to be unsubscribed */ virtual void remove_observer(const Event::EventID& event_id, - EventObserver& observer) = 0; + EventObserver& observer) = 0; /* * @brief Unsubscribes the observer from all events @@ -81,8 +80,7 @@ class EventDispatcher { /* * @brief Destructor */ - virtual ~EventDispatcher() { - }; + virtual ~EventDispatcher(){}; }; } // namespace event_engine 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 a36544c945..9a13ad608b 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 @@ -63,8 +63,12 @@ class EventDispatcherImpl : public EventDispatcher { EventDispatcherImpl(); #ifdef BUILD_TESTS - EventObserverMap get_observers() const { return observers_event_; } - ObserverVector get_observers_list() const { return observers_; } + EventObserverMap get_observers() const { + return observers_event_; + } + ObserverVector get_observers_list() const { + return observers_; + } #endif // BUILD_TESTS /* @@ -82,8 +86,8 @@ class EventDispatcherImpl : public EventDispatcher { * @param observer The observer to subscribe for event */ void add_observer(const Event::EventID& event_id, - int32_t hmi_correlation_id, - EventObserver& observer) OVERRIDE; + int32_t hmi_correlation_id, + EventObserver& observer) OVERRIDE; /* * @brief Unsubscribes the observer from specific event @@ -92,7 +96,7 @@ class EventDispatcherImpl : public EventDispatcher { * @param observer The observer to be unsubscribed */ void remove_observer(const Event::EventID& event_id, - EventObserver& observer) OVERRIDE; + EventObserver& observer) OVERRIDE; /* * @brief Unsubscribes the observer from all events @@ -102,7 +106,6 @@ class EventDispatcherImpl : public EventDispatcher { void remove_observer(EventObserver& observer) OVERRIDE; private: - /* * @brief removes observer * when occurs unsubscribe from event 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 d11591b587..3e910edfa9 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 @@ -110,4 +110,4 @@ const EventObserver::ObserverID& EventObserver::id() const { } // namespace event_engine } // namespace application_manager -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_OBSERVER_H_ +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_EVENT_OBSERVER_H_ diff --git a/src/components/application_manager/include/application_manager/hmi_capabilities.h b/src/components/application_manager/include/application_manager/hmi_capabilities.h index 70f7987cf4..db76e22fd6 100644 --- a/src/components/application_manager/include/application_manager/hmi_capabilities.h +++ b/src/components/application_manager/include/application_manager/hmi_capabilities.h @@ -54,9 +54,7 @@ namespace application_manager { class ApplicationManager; class HMICapabilities { - public: - /* * @ Class constructor * @@ -139,8 +137,7 @@ class HMICapabilities { * * @return Currently supported UI languages */ - inline const smart_objects::SmartObject* - ui_supported_languages() const; + inline const smart_objects::SmartObject* ui_supported_languages() const; /* * @brief Sets supported UI languages @@ -169,8 +166,7 @@ class HMICapabilities { * * @return Currently supported VR languages */ - inline const smart_objects::SmartObject* - vr_supported_languages() const; + inline const smart_objects::SmartObject* vr_supported_languages() const; /* * @brief Sets supported VR languages @@ -193,15 +189,14 @@ class HMICapabilities { * @param language Currently active TTS language */ void set_active_tts_language( - const hmi_apis::Common_Language::eType& language); + const hmi_apis::Common_Language::eType& language); /* * @brief Retrieves TTS supported languages * * @return Currently supported TTS languages */ - inline const smart_objects::SmartObject* - tts_supported_languages() const; + inline const smart_objects::SmartObject* tts_supported_languages() const; /* * @brief Sets supported TTS languages @@ -216,8 +211,7 @@ class HMICapabilities { * * @return Currently supported display capabilities */ - inline const smart_objects::SmartObject* - display_capabilities() const; + inline const smart_objects::SmartObject* display_capabilities() const; /* * @brief Sets supported display capabilities @@ -232,8 +226,7 @@ class HMICapabilities { * * @return Currently supported HMI zone capabilities */ - inline const smart_objects::SmartObject* - hmi_zone_capabilities() const; + inline const smart_objects::SmartObject* hmi_zone_capabilities() const; /* * @brief Sets supported HMI zone capabilities @@ -248,8 +241,7 @@ class HMICapabilities { * * @return Currently supported SoftButton's capabilities */ - inline const smart_objects::SmartObject* - soft_button_capabilities() const; + inline const smart_objects::SmartObject* soft_button_capabilities() const; /* * @brief Sets supported SoftButton's capabilities @@ -316,8 +308,7 @@ class HMICapabilities { * * @return Currently supported audio_pass_thru capabilities */ - inline const smart_objects::SmartObject* - audio_pass_thru_capabilities() const; + inline const smart_objects::SmartObject* audio_pass_thru_capabilities() const; /* * @brief Retrieves information about the preset bank capabilities @@ -361,7 +352,7 @@ class HMICapabilities { * @param prerecorded_speech supported prerecorded speech */ void set_prerecorded_speech( - const smart_objects::SmartObject& prerecorded_speech); + const smart_objects::SmartObject& prerecorded_speech); /* * @brief Interface used to store information if navigation @@ -394,7 +385,8 @@ class HMICapabilities { inline bool phone_call_supported() const; /* - * @brief Interface used to store information about software version of the target + * @brief Interface used to store information about software version of the + *target * * @param ccpu_version Received system/hmi software version */ @@ -410,7 +402,6 @@ class HMICapabilities { void Init(resumption::LastState* last_state); protected: - /* * @brief Loads capabilities from local file in case SDL was launched * without HMI @@ -429,8 +420,8 @@ class HMICapabilities { * @returns TRUE if member exists and returns FALSE if * member does not exist. */ - bool check_existing_json_member( - const Json::Value& json_member, const char* name_of_member); + bool check_existing_json_member(const Json::Value& json_member, + const char* name_of_member); /* * @brief function converts json object "languages" to smart object @@ -443,42 +434,42 @@ class HMICapabilities { smart_objects::SmartObject& languages); private: - bool is_vr_cooperating_; - bool is_tts_cooperating_; - bool is_ui_cooperating_; - bool is_navi_cooperating_; - bool is_ivi_cooperating_; + bool is_vr_cooperating_; + bool is_tts_cooperating_; + bool is_ui_cooperating_; + bool is_navi_cooperating_; + bool is_ivi_cooperating_; // to check if IsReady response for corresponding interface received - bool is_vr_ready_response_recieved_; - bool is_tts_ready_response_recieved_; - bool is_ui_ready_response_recieved_; - bool is_navi_ready_response_recieved_; - bool is_ivi_ready_response_recieved_; + bool is_vr_ready_response_recieved_; + bool is_tts_ready_response_recieved_; + bool is_ui_ready_response_recieved_; + bool is_navi_ready_response_recieved_; + bool is_ivi_ready_response_recieved_; - bool attenuated_supported_; + bool attenuated_supported_; hmi_apis::Common_Language::eType ui_language_; hmi_apis::Common_Language::eType vr_language_; hmi_apis::Common_Language::eType tts_language_; - smart_objects::SmartObject* vehicle_type_; - smart_objects::SmartObject* ui_supported_languages_; - smart_objects::SmartObject* tts_supported_languages_; - smart_objects::SmartObject* vr_supported_languages_; - smart_objects::SmartObject* display_capabilities_; - smart_objects::SmartObject* hmi_zone_capabilities_; - smart_objects::SmartObject* soft_buttons_capabilities_; - smart_objects::SmartObject* button_capabilities_; - smart_objects::SmartObject* preset_bank_capabilities_; - smart_objects::SmartObject* vr_capabilities_; - smart_objects::SmartObject* speech_capabilities_; - smart_objects::SmartObject* audio_pass_thru_capabilities_; - smart_objects::SmartObject* prerecorded_speech_; - std::string ccpu_version_; - bool is_navigation_supported_; - bool is_phone_call_supported_; - - ApplicationManager& app_mngr_; - HMILanguageHandler hmi_language_handler_; + smart_objects::SmartObject* vehicle_type_; + smart_objects::SmartObject* ui_supported_languages_; + smart_objects::SmartObject* tts_supported_languages_; + smart_objects::SmartObject* vr_supported_languages_; + smart_objects::SmartObject* display_capabilities_; + smart_objects::SmartObject* hmi_zone_capabilities_; + smart_objects::SmartObject* soft_buttons_capabilities_; + smart_objects::SmartObject* button_capabilities_; + smart_objects::SmartObject* preset_bank_capabilities_; + smart_objects::SmartObject* vr_capabilities_; + smart_objects::SmartObject* speech_capabilities_; + smart_objects::SmartObject* audio_pass_thru_capabilities_; + smart_objects::SmartObject* prerecorded_speech_; + std::string ccpu_version_; + bool is_navigation_supported_; + bool is_phone_call_supported_; + + ApplicationManager& app_mngr_; + HMILanguageHandler hmi_language_handler_; DISALLOW_COPY_AND_ASSIGN(HMICapabilities); }; @@ -503,33 +494,33 @@ bool HMICapabilities::is_ivi_cooperating() const { return is_ivi_cooperating_; } -const smart_objects::SmartObject* -HMICapabilities::ui_supported_languages() const { +const smart_objects::SmartObject* HMICapabilities::ui_supported_languages() + const { return ui_supported_languages_; } -const smart_objects::SmartObject* -HMICapabilities::vr_supported_languages() const { +const smart_objects::SmartObject* HMICapabilities::vr_supported_languages() + const { return vr_supported_languages_; } -const smart_objects::SmartObject* -HMICapabilities::tts_supported_languages() const { +const smart_objects::SmartObject* HMICapabilities::tts_supported_languages() + const { return tts_supported_languages_; } -const smart_objects::SmartObject* -HMICapabilities::display_capabilities() const { +const smart_objects::SmartObject* HMICapabilities::display_capabilities() + const { return display_capabilities_; } -const smart_objects::SmartObject* -HMICapabilities::hmi_zone_capabilities() const { +const smart_objects::SmartObject* HMICapabilities::hmi_zone_capabilities() + const { return hmi_zone_capabilities_; } -const smart_objects::SmartObject* -HMICapabilities::soft_button_capabilities() const { +const smart_objects::SmartObject* HMICapabilities::soft_button_capabilities() + const { return soft_buttons_capabilities_; } @@ -537,8 +528,7 @@ const smart_objects::SmartObject* HMICapabilities::button_capabilities() const { return button_capabilities_; } -const smart_objects::SmartObject* -HMICapabilities::speech_capabilities() const { +const smart_objects::SmartObject* HMICapabilities::speech_capabilities() const { return speech_capabilities_; } @@ -551,8 +541,8 @@ HMICapabilities::audio_pass_thru_capabilities() const { return audio_pass_thru_capabilities_; } -const smart_objects::SmartObject* -HMICapabilities::preset_bank_capabilities() const { +const smart_objects::SmartObject* HMICapabilities::preset_bank_capabilities() + const { return preset_bank_capabilities_; } @@ -564,8 +554,7 @@ const smart_objects::SmartObject* HMICapabilities::vehicle_type() const { return vehicle_type_; } -const smart_objects::SmartObject* -HMICapabilities::prerecorded_speech() const { +const smart_objects::SmartObject* HMICapabilities::prerecorded_speech() const { return prerecorded_speech_; } 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 fe5d480c79..6e4d9785f6 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 @@ -41,7 +41,6 @@ class LastState; } namespace application_manager { - class ApplicationManager; /** * Class is used to handle edge case with slow HMI responses for current @@ -50,18 +49,14 @@ class ApplicationManager; * responses are gotten and after responses were received their language(s) * mismatch to current on HMI - apps have to be unregistered. **/ -class HMILanguageHandler: public event_engine::EventObserver { -public: +class HMILanguageHandler : public event_engine::EventObserver { + public: typedef std::map<uint32_t, bool> Apps; /** * @brief System interfaces */ - enum Interface { - INTERFACE_UI, - INTERFACE_VR, - INTERFACE_TTS - }; + enum Interface { INTERFACE_UI, INTERFACE_VR, INTERFACE_TTS }; /** * @brief Class constructor @@ -90,7 +85,7 @@ public: * @param request Request object */ void set_handle_response_for( - const event_engine::smart_objects::SmartObject& request); + const event_engine::smart_objects::SmartObject& request); /** * @brief Sets default languages from HMI capabilities @@ -103,7 +98,7 @@ public: hmi_apis::Common_Language::eType tts); void Init(resumption::LastState* value); -private: + private: void SendOnLanguageChangeToMobile(uint32_t connection_key); /** @@ -180,7 +175,6 @@ private: ApplicationManager& application_manager_; }; -} // namespace application_manager - -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_LANGUAGE_HANDLER_H_ +} // namespace application_manager +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMI_LANGUAGE_HANDLER_H_ 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 ffdb183149..93784e9671 100644 --- a/src/components/application_manager/include/application_manager/hmi_state.h +++ b/src/components/application_manager/include/application_manager/hmi_state.h @@ -71,7 +71,9 @@ class HmiState { }; HmiState(uint32_t app_id, const ApplicationManager& app_mngr); - HmiState(uint32_t app_id, const ApplicationManager& app_mngr, StateID state_id); + HmiState(uint32_t app_id, + const ApplicationManager& app_mngr, + StateID state_id); virtual ~HmiState() {} @@ -203,7 +205,8 @@ class HmiState { */ class VRHmiState : public HmiState { public: - virtual mobile_apis::AudioStreamingState::eType audio_streaming_state() const OVERRIDE; + virtual mobile_apis::AudioStreamingState::eType audio_streaming_state() + const OVERRIDE; VRHmiState(uint32_t app_id, const ApplicationManager& app_mngr); }; @@ -213,7 +216,8 @@ class VRHmiState : public HmiState { class TTSHmiState : public HmiState { public: TTSHmiState(uint32_t app_id, const ApplicationManager& app_mngr); - virtual mobile_apis::AudioStreamingState::eType audio_streaming_state() const OVERRIDE; + virtual mobile_apis::AudioStreamingState::eType audio_streaming_state() + const OVERRIDE; }; /** @@ -223,11 +227,13 @@ class TTSHmiState : public HmiState { class NaviStreamingHmiState : public HmiState { public: NaviStreamingHmiState(uint32_t app_id, const ApplicationManager& app_mngr); - mobile_apis::AudioStreamingState::eType audio_streaming_state() const OVERRIDE; + mobile_apis::AudioStreamingState::eType audio_streaming_state() + const OVERRIDE; }; /** - * @brief The PhoneCallHmiState class implements logic of PhoneCall temporary state + * @brief The PhoneCallHmiState class implements logic of PhoneCall temporary + * state */ class PhoneCallHmiState : public HmiState { public: @@ -281,7 +287,8 @@ class AudioSource : public HmiState { }; /** - * @brief The EmbeddedNavi class implements logic of OnEventChanged(EMBEDDED_NAVI) + * @brief The EmbeddedNavi class implements logic of + * OnEventChanged(EMBEDDED_NAVI) * temporary state */ class EmbeddedNavi : public HmiState { @@ -293,6 +300,5 @@ class EmbeddedNavi : public HmiState { return mobile_apis::AudioStreamingState::NOT_AUDIBLE; } }; - } #endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_HMISTATE_H diff --git a/src/components/application_manager/include/application_manager/message_helper.h b/src/components/application_manager/include/application_manager/message_helper.h index 0b91bcf257..ab89883ad2 100644 --- a/src/components/application_manager/include/application_manager/message_helper.h +++ b/src/components/application_manager/include/application_manager/message_helper.h @@ -81,9 +81,9 @@ class MessageHelper { * (e.g. gps, odometer, fuel_level) */ static void CreateGetVehicleDataRequest( - const uint32_t correlation_id, - const std::vector<std::string>& params, - ApplicationManager &app_mngr); + const uint32_t correlation_id, + const std::vector<std::string>& params, + ApplicationManager& app_mngr); /** * @brief Create mobile HashUpdateNotification @@ -94,7 +94,8 @@ class MessageHelper { /** * @brief Sends to mobile HashUpdateNotification */ - static void SendHashUpdateNotification(const uint32_t app_id, ApplicationManager &app_mngr); + static void SendHashUpdateNotification(const uint32_t app_id, + ApplicationManager& app_mngr); /** * @brief Sends OnLanguageChange notification to application @@ -198,9 +199,10 @@ class MessageHelper { * @param devices Devices list * */ - static smart_objects::SmartObjectSPtr CreateDeviceListSO(const connection_handler::DeviceMap& devices, - const policy::PolicyHandlerInterface& policy_handler, - ApplicationManager &app_mngr); + static smart_objects::SmartObjectSPtr CreateDeviceListSO( + const connection_handler::DeviceMap& devices, + const policy::PolicyHandlerInterface& policy_handler, + ApplicationManager& app_mngr); static smart_objects::SmartObjectSPtr CreateModuleInfoSO( uint32_t function_id, ApplicationManager& app_mngr); @@ -211,30 +213,35 @@ class MessageHelper { /** * @brief Sends IVI subscription requests */ - static bool SendIVISubscribtions(const uint32_t app_id, ApplicationManager &app_mngr); + static bool SendIVISubscribtions(const uint32_t app_id, + ApplicationManager& app_mngr); /** * @brief Returns IVI subscription requests */ - static smart_objects::SmartObjectList GetIVISubscriptionRequests(ApplicationSharedPtr app, ApplicationManager& app_mngr); + static smart_objects::SmartObjectList GetIVISubscriptionRequests( + ApplicationSharedPtr app, ApplicationManager& app_mngr); /** * @brief Sends button subscription notification */ static void SendOnButtonSubscriptionNotification( - const uint32_t app_id, - const hmi_apis::Common_ButtonName::eType button, - const bool is_subscribed, - ApplicationManager &app_mngr); + const uint32_t app_id, + const hmi_apis::Common_ButtonName::eType button, + const bool is_subscribed, + ApplicationManager& app_mngr); /** * @brief Sends button subscription notifications for all buttons * that application is subscribed on */ - static void SendAllOnButtonSubscriptionNotificationsForApp(ApplicationConstSharedPtr app, ApplicationManager &app_mngr); + static void SendAllOnButtonSubscriptionNotificationsForApp( + ApplicationConstSharedPtr app, ApplicationManager& app_mngr); - static void SendAppDataToHMI(ApplicationConstSharedPtr app, ApplicationManager& app_man); - static void SendGlobalPropertiesToHMI(ApplicationConstSharedPtr app, ApplicationManager &app_mngr); + static void SendAppDataToHMI(ApplicationConstSharedPtr app, + ApplicationManager& app_man); + static void SendGlobalPropertiesToHMI(ApplicationConstSharedPtr app, + ApplicationManager& app_mngr); static smart_objects::SmartObjectList CreateGlobalPropertiesRequestsToHMI( ApplicationConstSharedPtr app, const uint32_t correlation_id); @@ -243,9 +250,12 @@ class MessageHelper { static smart_objects::SmartObjectList CreateShowRequestToHMI( ApplicationConstSharedPtr app, const uint32_t correlation_id); - static void SendShowRequestToHMI(ApplicationConstSharedPtr app, ApplicationManager &app_mngr); - static void SendShowConstantTBTRequestToHMI(ApplicationConstSharedPtr app, ApplicationManager& app_man); - static void SendAddCommandRequestToHMI(ApplicationConstSharedPtr app, ApplicationManager &app_man); + static void SendShowRequestToHMI(ApplicationConstSharedPtr app, + ApplicationManager& app_mngr); + static void SendShowConstantTBTRequestToHMI(ApplicationConstSharedPtr app, + ApplicationManager& app_man); + static void SendAddCommandRequestToHMI(ApplicationConstSharedPtr app, + ApplicationManager& app_man); static smart_objects::SmartObjectList CreateAddCommandRequestToHMI( ApplicationConstSharedPtr app, ApplicationManager& app_mngr); @@ -257,15 +267,21 @@ class MessageHelper { * @brief Sends UI_ChangeRegistration to HMI with list of AppHMIType * @param app applicaton instace */ - static void SendUIChangeRegistrationRequestToHMI(ApplicationConstSharedPtr app, ApplicationManager &app_mngr); - static void SendChangeRegistrationRequestToHMI(ApplicationConstSharedPtr app, ApplicationManager &app_mngr); - static void SendAddVRCommandToHMI(uint32_t cmd_id, + static void SendUIChangeRegistrationRequestToHMI( + ApplicationConstSharedPtr app, ApplicationManager& app_mngr); + static void SendChangeRegistrationRequestToHMI(ApplicationConstSharedPtr app, + ApplicationManager& app_mngr); + static void SendAddVRCommandToHMI( + uint32_t cmd_id, const smart_objects::SmartObject& vr_commands, - const uint32_t app_id, ApplicationManager &app_mngr); + const uint32_t app_id, + ApplicationManager& app_mngr); - static smart_objects::SmartObjectSPtr CreateAddVRCommandToHMI(uint32_t cmd_id, + static smart_objects::SmartObjectSPtr CreateAddVRCommandToHMI( + uint32_t cmd_id, const smart_objects::SmartObject& vr_commands, - const uint32_t app_id, ApplicationManager &app_mngr); + const uint32_t app_id, + ApplicationManager& app_mngr); /* * @brief Create Common.HMIApplication struct application instance @@ -273,13 +289,17 @@ class MessageHelper { * @param output smart object to store Common.HMIApplication struct * @return true on succes, otherwise return false; */ - static bool CreateHMIApplicationStruct(ApplicationConstSharedPtr app, + static bool CreateHMIApplicationStruct( + ApplicationConstSharedPtr app, const protocol_handler::SessionObserver& session_observer, - const policy::PolicyHandlerInterface &policy_handler, - smart_objects::SmartObject* output, ApplicationManager &app_mngr); + const policy::PolicyHandlerInterface& policy_handler, + smart_objects::SmartObject* output, + ApplicationManager& app_mngr); - static void SendAddSubMenuRequestToHMI(ApplicationConstSharedPtr app, ApplicationManager &app_mngr); - static smart_objects::SmartObjectList CreateAddSubMenuRequestToHMI(ApplicationConstSharedPtr app, const uint32_t correlation_id); + static void SendAddSubMenuRequestToHMI(ApplicationConstSharedPtr app, + ApplicationManager& app_mngr); + static smart_objects::SmartObjectList CreateAddSubMenuRequestToHMI( + ApplicationConstSharedPtr app, const uint32_t correlation_id); /* * @brief Creates BasicCommunication.OnAppUnregistered notification @@ -287,29 +307,36 @@ class MessageHelper { * @param is_unexpected_disconnect * Indicates if connection was unexpectedly lost by TM or HB */ - static void SendOnAppUnregNotificationToHMI(ApplicationConstSharedPtr app, bool is_unexpected_disconnect, ApplicationManager &app_mngr); + static void SendOnAppUnregNotificationToHMI(ApplicationConstSharedPtr app, + bool is_unexpected_disconnect, + ApplicationManager& app_mngr); static NsSmartDeviceLink::NsSmartObjects::SmartObjectSPtr - GetBCActivateAppRequestToHMI(ApplicationConstSharedPtr app, + 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); + bool send_policy_priority, + ApplicationManager& app_mngr); - static void SendOnResumeAudioSourceToHMI(const uint32_t app_id, 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 */ - static void SendSDLActivateAppResponse(policy::AppPermissions& permissions, uint32_t correlation_id, - ApplicationManager &app_mngr); + 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 */ - static void SendOnSDLConsentNeeded(const policy::DeviceParams& device_info, ApplicationManager& app_man); + static void SendOnSDLConsentNeeded(const policy::DeviceParams& device_info, + ApplicationManager& app_man); /** * @brief Send request to SyncP process to read file and send @@ -321,15 +348,17 @@ class MessageHelper { static void SendPolicyUpdate(const std::string& file_path, int timeout, const std::vector<int>& retries, - ApplicationManager &app_mngr); + ApplicationManager& app_mngr); /** * @brief Send GetUserFriendlyMessage response to HMI * @param msg Appopriate messages params * @param correlation_id Correlation id of request */ - static void SendGetUserFriendlyMessageResponse(const std::vector<policy::UserFriendlyMessage>& msg, - uint32_t correlation_id, ApplicationManager &app_mngr); + static void SendGetUserFriendlyMessageResponse( + const std::vector<policy::UserFriendlyMessage>& msg, + uint32_t correlation_id, + ApplicationManager& app_mngr); /** * @brief Send GetListOfPermissions response to HMI @@ -347,7 +376,7 @@ class MessageHelper { * @param connection_key Application connection key * */ - static void SendNaviStartStream(int32_t app_id, ApplicationManager &app_mngr); + static void SendNaviStartStream(int32_t app_id, ApplicationManager& app_mngr); /* * @brief Sends notification to HMI to stop video streaming @@ -355,7 +384,7 @@ class MessageHelper { * @param connection_key Application connection key * */ - static void SendNaviStopStream(int32_t app_id, ApplicationManager &app_mngr); + static void SendNaviStopStream(int32_t app_id, ApplicationManager& app_mngr); /* * @brief Send notification for Update of Policy Table @@ -365,13 +394,16 @@ class MessageHelper { * @param url If empty string, no URL is provided * @param timeout If -1 no timeout is provdied */ - static void SendPolicySnapshotNotification(uint32_t connection_key, + static void SendPolicySnapshotNotification( + uint32_t connection_key, const std::vector<uint8_t>& policy_data, const std::string& url, ApplicationManager& app_mngr); - static void SendSystemRequestNotification(uint32_t connection_key, - NsSmartDeviceLink::NsSmartObjects::SmartObject& content, ApplicationManager &app_mngr); + static void SendSystemRequestNotification( + uint32_t connection_key, + NsSmartDeviceLink::NsSmartObjects::SmartObject& content, + ApplicationManager& app_mngr); /** * @brief SendLaunchApp allows to send OnSystemRequest with LAUNCH_UP. @@ -399,7 +431,10 @@ class MessageHelper { * @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); + static void SendOnPermissionsChangeNotification( + uint32_t connection_key, + const policy::Permissions& permissions, + ApplicationManager& app_mngr); /* * @brief Send notification to HMI on application permissions update @@ -407,7 +442,9 @@ class MessageHelper { * @param permissions updated permissions for application */ static void SendOnAppPermissionsChangedNotification( - uint32_t connection_key, const policy::AppPermissions& permissions, ApplicationManager& app_mngr); + uint32_t connection_key, + const policy::AppPermissions& permissions, + ApplicationManager& app_mngr); /** * @brief Send GetStatusUpdate response to HMI with current policy update @@ -416,7 +453,8 @@ class MessageHelper { * @param correlation_id Correlation id from request */ static void SendGetStatusUpdateResponse(const std::string& status, - const uint32_t correlation_id, ApplicationManager &app_mngr); + const uint32_t correlation_id, + ApplicationManager& app_mngr); /** * @brief Send UpdateSDL response to HMI with policy update result @@ -424,18 +462,20 @@ class MessageHelper { * @param correlation_id Correlation id from request */ static void SendUpdateSDLResponse(const std::string& result, - const uint32_t correlation_id, ApplicationManager &app_mngr); + const uint32_t correlation_id, + ApplicationManager& app_mngr); /** * @brief Send OnStatusUpdate to HMI on policy update status change * @param status Policy table update status */ - static void SendOnStatusUpdate(const std::string& status, ApplicationManager& app_mngr); + static void SendOnStatusUpdate(const std::string& status, + ApplicationManager& app_mngr); /** * @brief Send GetSystemInfo request to HMI */ - static void SendGetSystemInfoRequest(ApplicationManager &app_mngr); + static void SendGetSystemInfoRequest(ApplicationManager& app_mngr); /* * @brief Sends notification to HMI to start audio streaming @@ -443,7 +483,8 @@ class MessageHelper { * @param connection_key Application connection key * */ - static void SendAudioStartStream(int32_t app_id, ApplicationManager &app_mngr); + static void SendAudioStartStream(int32_t app_id, + ApplicationManager& app_mngr); /* * @brief Sends notification to HMI to stop audio streaming @@ -451,10 +492,12 @@ class MessageHelper { * @param connection_key Application connection key * */ - static void SendAudioStopStream(int32_t connection_key, ApplicationManager &app_mngr); + static void SendAudioStopStream(int32_t connection_key, + ApplicationManager& app_mngr); static void SendOnDataStreaming(protocol_handler::ServiceType service, - bool available, ApplicationManager &app_mngr); + bool available, + ApplicationManager& app_mngr); /* * @brief Sends notification to HMI to stop audioPathThru @@ -463,7 +506,7 @@ class MessageHelper { * * @return TRUE on SUCCES otherwise return FALSE */ - static bool SendStopAudioPathThru(ApplicationManager &app_mngr); + static bool SendStopAudioPathThru(ApplicationManager& app_mngr); /** * @brief Sends UnsubscribeWayPoints request @@ -504,9 +547,14 @@ class MessageHelper { * */ static mobile_apis::Result::eType VerifyImageFiles( - smart_objects::SmartObject& message, ApplicationConstSharedPtr app, ApplicationManager& app_mngr); + smart_objects::SmartObject& message, + ApplicationConstSharedPtr app, + ApplicationManager& app_mngr); - static mobile_apis::Result::eType VerifyImageVrHelpItems(smart_objects::SmartObject& message, ApplicationConstSharedPtr app, ApplicationManager &app_mngr); + static mobile_apis::Result::eType VerifyImageVrHelpItems( + smart_objects::SmartObject& message, + ApplicationConstSharedPtr app, + ApplicationManager& app_mngr); /** * @brief Checks string if it contains incorrect character \t\n \\t \\n @@ -553,76 +601,80 @@ class MessageHelper { static std::string CommonLanguageToString( hmi_apis::Common_Language::eType language); - /** - * @brief Converts string to mobile language enum value - * @param language language as string - * @return Mobile language enum value - */ - static mobile_apis::Language::eType MobileLanguageFromString( - const std::string& language); - - /** - * @brief Converts mobile language enum to HMI language enum - * @param language Mobile language enum - * @return HMI language enum - */ - static hmi_apis::Common_Language::eType MobileToCommonLanguage( - const mobile_apis::Language::eType language); - - /** - * @brief Converts HMI language enum to mobile language enum - * @param language HMI language enum - * @return Mobile language enum - */ - static mobile_apis::Language::eType CommonToMobileLanguage( - const hmi_apis::Common_Language::eType language); - - /** - * @brief Gets command limit number per minute for specific application - * @param policy_app_id Unique application id - * @return Limit for number of command per minute - */ - static uint32_t GetAppCommandLimit(const std::string& policy_app_id); - - /** - * @brief Creates TTS.SetGlobalProperties request and sends - * to HMI for VCA module. - * @param app contains application which sends TTS GlobalProperties to HMI - * after timeout or first time when application register with level NONE or - * BACKGROUND - * @param default_help_prompt - * if default_help_prompt=TRUE->TTSGlobalProperties request will be created with - * default helpPrompt array, otherwise TTSGlobalProperties request will be created - * with empty helpPrompt array. - */ - static void SendTTSGlobalProperties( - ApplicationSharedPtr app, const bool default_help_prompt, ApplicationManager& app_man); - - /** - * @brief SendSetAppIcon allows to send SetAppIcon request. - * - * @param app_id application for which icon request should be sent. - * - * @param icon_path path to the icon. - */ - static void SendSetAppIcon(const uint32_t app_id, - const std::string& icon_path, - ApplicationManager& application_manager); - - static hmi_apis::Common_Language::eType CommonLanguageFromString( - const std::string& language); - - static smart_objects::SmartObjectSPtr - GetOnAppInterfaceUnregisteredNotificationToMobile( - int32_t connection_key, - mobile_api::AppInterfaceUnregisteredReason::eType reason); - - private: + /** + * @brief Converts string to mobile language enum value + * @param language language as string + * @return Mobile language enum value + */ + static mobile_apis::Language::eType MobileLanguageFromString( + const std::string& language); + + /** + * @brief Converts mobile language enum to HMI language enum + * @param language Mobile language enum + * @return HMI language enum + */ + static hmi_apis::Common_Language::eType MobileToCommonLanguage( + const mobile_apis::Language::eType language); + + /** + * @brief Converts HMI language enum to mobile language enum + * @param language HMI language enum + * @return Mobile language enum + */ + static mobile_apis::Language::eType CommonToMobileLanguage( + const hmi_apis::Common_Language::eType language); + + /** + * @brief Gets command limit number per minute for specific application + * @param policy_app_id Unique application id + * @return Limit for number of command per minute + */ + static uint32_t GetAppCommandLimit(const std::string& policy_app_id); + + /** + * @brief Creates TTS.SetGlobalProperties request and sends + * to HMI for VCA module. + * @param app contains application which sends TTS GlobalProperties to HMI + * after timeout or first time when application register with level NONE or + * BACKGROUND + * @param default_help_prompt + * if default_help_prompt=TRUE->TTSGlobalProperties request will be created + * with + * default helpPrompt array, otherwise TTSGlobalProperties request will be + * created + * with empty helpPrompt array. + */ + static void SendTTSGlobalProperties(ApplicationSharedPtr app, + const bool default_help_prompt, + ApplicationManager& app_man); + + /** + * @brief SendSetAppIcon allows to send SetAppIcon request. + * + * @param app_id application for which icon request should be sent. + * + * @param icon_path path to the icon. + */ + static void SendSetAppIcon(const uint32_t app_id, + const std::string& icon_path, + ApplicationManager& application_manager); + + static hmi_apis::Common_Language::eType CommonLanguageFromString( + const std::string& language); + + static smart_objects::SmartObjectSPtr + GetOnAppInterfaceUnregisteredNotificationToMobile( + int32_t connection_key, + mobile_api::AppInterfaceUnregisteredReason::eType reason); + + private: /** * @brief Creates new request object and fill its header * @return New request object */ - static smart_objects::SmartObjectSPtr CreateRequestObject(const uint32_t correlation_id); + static smart_objects::SmartObjectSPtr CreateRequestObject( + const uint32_t correlation_id); /** * @brief Allows to fill SO according to the current permissions. @@ -633,12 +685,12 @@ class MessageHelper { const policy::AppPermissions& permissions, smart_objects::SmartObject& message); - static smart_objects::SmartObjectSPtr CreateChangeRegistration( - const int32_t function_id, - const int32_t language, - const uint32_t app_id, - const smart_objects::SmartObject* app_types, - ApplicationManager& app_mngr); + static smart_objects::SmartObjectSPtr CreateChangeRegistration( + const int32_t function_id, + const int32_t language, + const uint32_t app_id, + const smart_objects::SmartObject* app_types, + ApplicationManager& app_mngr); MessageHelper(); diff --git a/src/components/application_manager/include/application_manager/policies/delegates/app_permission_delegate.h b/src/components/application_manager/include/application_manager/policies/delegates/app_permission_delegate.h index 9acd258b67..6913f5038e 100644 --- a/src/components/application_manager/include/application_manager/policies/delegates/app_permission_delegate.h +++ b/src/components/application_manager/include/application_manager/policies/delegates/app_permission_delegate.h @@ -33,7 +33,6 @@ #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/threads/thread.h" #include "utils/threads/thread_delegate.h" #include "utils/conditional_variable.h" @@ -42,42 +41,42 @@ #include "application_manager/policies/policy_handler_interface.h" namespace policy { +/** +*@brief The AppPermissionDelegate class allows to call OnAppPermissionConsent +*in async way. +*/ +class AppPermissionDelegate : public threads::ThreadDelegate { + public: /** - * @brief The AppPermissionDelegate class allows to call OnAppPermissionConsent - * in async way. - */ -class AppPermissionDelegate: public threads::ThreadDelegate { - public: - /** - * @brief AppPermissionDelegate constructor, contains parameters - * which will be pass to the called function. - * - * @param connection_key connection key. - * - * @param permissions new permissions - */ - AppPermissionDelegate(const uint32_t connection_key, - const PermissionConsent& permissions, - policy::PolicyHandlerInterface& policy_handler); + * @brief AppPermissionDelegate constructor, contains parameters + * which will be pass to the called function. + * + * @param connection_key connection key. + * + * @param permissions new permissions + */ + AppPermissionDelegate(const uint32_t connection_key, + const PermissionConsent& permissions, + policy::PolicyHandlerInterface& policy_handler); - /** - * @brief threadMain run the needed function. - */ - virtual void threadMain(); + /** + * @brief threadMain run the needed function. + */ + virtual void threadMain(); - /** - * @brief exitThreadMain do some stuff before exit from thread - * - * @return true in case when thread has been finished properly - */ - virtual void exitThreadMain(); + /** + * @brief exitThreadMain do some stuff before exit from thread + * + * @return true in case when thread has been finished properly + */ + virtual void exitThreadMain(); - private: - uint32_t connection_key_; - PermissionConsent permissions_; - policy::PolicyHandlerInterface& policy_handler_; + private: + uint32_t connection_key_; + PermissionConsent permissions_; + policy::PolicyHandlerInterface& policy_handler_; }; -} // namespace policy +} // namespace policy -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_DELEGATES_APP_PERMISSION_DELEGATE_H_ +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_DELEGATES_APP_PERMISSION_DELEGATE_H_ diff --git a/src/components/application_manager/include/application_manager/policies/policy_event_observer.h b/src/components/application_manager/include/application_manager/policies/policy_event_observer.h index b2de2fde36..13f070a1ec 100644 --- a/src/components/application_manager/include/application_manager/policies/policy_event_observer.h +++ b/src/components/application_manager/include/application_manager/policies/policy_event_observer.h @@ -41,8 +41,8 @@ namespace smart_objects = NsSmartDeviceLink::NsSmartObjects; class PolicyHandlerInterface; -class PolicyEventObserver : - public application_manager::event_engine::EventObserver { +class PolicyEventObserver + : public application_manager::event_engine::EventObserver { public: PolicyEventObserver( policy::PolicyHandlerInterface* const policy_handler, @@ -52,6 +52,7 @@ class PolicyEventObserver : void subscribe_on_event( const application_manager::event_engine::Event::EventID& event_id, int32_t hmi_correlation_id = 0); + private: sync_primitives::Lock policy_handler_lock_; PolicyHandlerInterface* policy_handler_; 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 26872a5af5..993462ecb8 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 @@ -68,10 +68,9 @@ typedef std::vector<uint32_t> AppIds; typedef std::vector<uint32_t> DeviceHandles; namespace custom_str = utils::custom_string; -class PolicyHandler - : public PolicyHandlerInterface, - public PolicyListener, - public threads::AsyncRunner { +class PolicyHandler : public PolicyHandlerInterface, + public PolicyListener, + public threads::AsyncRunner { public: PolicyHandler(const policy::PolicySettings& get_settings, application_manager::ApplicationManager& application_manager); @@ -81,7 +80,8 @@ class PolicyHandler bool InitPolicyTable() OVERRIDE; bool ResetPolicyTable() OVERRIDE; bool ClearUserConsent() OVERRIDE; - bool SendMessageToSDK(const BinaryMessage& pt_string, const std::string& url) OVERRIDE; + bool SendMessageToSDK(const BinaryMessage& pt_string, + const std::string& url) OVERRIDE; bool ReceiveMessageFromSDK(const std::string& file, const BinaryMessage& pt_string) OVERRIDE; bool UnloadPolicyLibrary() OVERRIDE; @@ -94,7 +94,8 @@ class PolicyHandler virtual void OnSnapshotCreated(const BinaryMessage& pt_string) OVERRIDE; - virtual bool GetPriority(const std::string& policy_app_id, std::string* priority) const OVERRIDE; + virtual bool GetPriority(const std::string& policy_app_id, + std::string* priority) const OVERRIDE; void CheckPermissions(const PTString& app_id, const PTString& hmi_level, const PTString& rpc, @@ -102,7 +103,8 @@ class PolicyHandler CheckPermissionResult& result) OVERRIDE; uint32_t GetNotificationsNumber(const std::string& priority) const OVERRIDE; - virtual DeviceConsent GetUserConsentForDevice(const std::string& device_id) const OVERRIDE; + virtual DeviceConsent GetUserConsentForDevice( + const std::string& device_id) const OVERRIDE; bool GetDefaultHmi(const std::string& policy_app_id, std::string* default_hmi) const OVERRIDE; bool GetInitialAppData(const std::string& application_id, @@ -119,7 +121,8 @@ class PolicyHandler void add_listener(PolicyHandlerObserver* listener) OVERRIDE; void remove_listener(PolicyHandlerObserver* listener) OVERRIDE; - utils::SharedPtr<usage_statistics::StatisticsManager> GetStatisticManager() const OVERRIDE; + utils::SharedPtr<usage_statistics::StatisticsManager> GetStatisticManager() + const OVERRIDE; /** * @brief CheckSystemAction allows to check whether certain system @@ -149,8 +152,8 @@ class PolicyHandler * @param Device id or empty string, if concern to all SDL functionality * @param User consent from response */ - void OnAllowSDLFunctionalityNotification(bool is_allowed, - const std::string& device_id) OVERRIDE; + void OnAllowSDLFunctionalityNotification( + bool is_allowed, const std::string& device_id) OVERRIDE; /** * @brief Increment counter for ignition cycles @@ -228,7 +231,8 @@ class PolicyHandler * application * @param policy_app_id Application id */ - std::string OnCurrentDeviceIdUpdateRequired(const std::string& policy_app_id) OVERRIDE; + std::string OnCurrentDeviceIdUpdateRequired( + const std::string& policy_app_id) OVERRIDE; /** * @brief Set parameters from OnSystemInfoChanged to policy table @@ -260,7 +264,8 @@ class PolicyHandler * @brief Allows to update vechicle data info. * @param SmartObject which contains all needed information. */ - virtual void OnVehicleDataUpdated(const smart_objects::SmartObject& message) OVERRIDE; + virtual void OnVehicleDataUpdated( + const smart_objects::SmartObject& message) OVERRIDE; /** * Removes device @@ -286,12 +291,14 @@ class PolicyHandler */ uint32_t GetAppIdForSending() const OVERRIDE; - custom_str::CustomString GetAppName(const std::string& policy_app_id) OVERRIDE; + custom_str::CustomString GetAppName( + const std::string& policy_app_id) OVERRIDE; virtual void OnUpdateHMIAppType( std::map<std::string, StringArray> app_hmi_types) OVERRIDE; - virtual void OnCertificateUpdated(const std::string& certificate_data) OVERRIDE; + virtual void OnCertificateUpdated( + const std::string& certificate_data) OVERRIDE; virtual bool CanUpdate() OVERRIDE; @@ -354,8 +361,9 @@ class PolicyHandler * @param type Request type * @return true, if allowed, otherwise - false */ - bool IsRequestTypeAllowed(const std::string& policy_app_id, - mobile_apis::RequestType::eType type) const OVERRIDE; + bool IsRequestTypeAllowed( + const std::string& policy_app_id, + mobile_apis::RequestType::eType type) const OVERRIDE; /** * @brief Gets application request types @@ -401,9 +409,9 @@ class PolicyHandler std::string RetrieveCertificate() const OVERRIDE; #endif // ENABLE_SECURITY - const PolicySettings &get_settings() const OVERRIDE; + const PolicySettings& get_settings() const OVERRIDE; - protected: + protected: /** * Starts next retry exchange policy table */ @@ -447,8 +455,7 @@ class PolicyHandler private: class StatisticManagerImpl : public usage_statistics::StatisticsManager { - public: - + public: StatisticManagerImpl(PolicyHandler* policy_handler) : policy_handler_(policy_handler) { DCHECK(policy_handler_); @@ -459,25 +466,26 @@ class PolicyHandler } void Increment(const std::string& app_id, - usage_statistics::AppCounterId type) { + usage_statistics::AppCounterId type) { policy_handler_->AsyncRun( new StatisticsDelegate(*policy_handler_, app_id, type)); } void Set(const std::string& app_id, - usage_statistics::AppInfoId type, - const std::string& value) { + usage_statistics::AppInfoId type, + const std::string& value) { policy_handler_->AsyncRun( new StatisticsDelegate(*policy_handler_, app_id, type, value)); } void Add(const std::string& app_id, - usage_statistics::AppStopwatchId type, - int32_t timespan_seconds) { + usage_statistics::AppStopwatchId type, + int32_t timespan_seconds) { policy_handler_->AsyncRun(new StatisticsDelegate( *policy_handler_, app_id, type, timespan_seconds)); } - private: + + private: PolicyHandler* policy_handler_; }; 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 259abc6c0f..237d9f5d8a 100644 --- a/src/components/application_manager/include/application_manager/request_controller.h +++ b/src/components/application_manager/include/application_manager/request_controller.h @@ -50,7 +50,6 @@ #include "application_manager/request_info.h" #include "application_manager/request_controller_settings.h" - namespace application_manager { namespace request_controller { @@ -60,233 +59,231 @@ namespace request_controller { * requests. */ class RequestController { - public: - /** - * @brief Result code for addRequest - */ - enum TResult { - SUCCESS = 0, - TOO_MANY_REQUESTS, - TOO_MANY_PENDING_REQUESTS, - NONE_HMI_LEVEL_MANY_REQUESTS, - INVALID_DATA - }; - - /** - * @brief Thread pool state - */ - enum TPoolState { - UNDEFINED = 0, - STARTED, - STOPPED, - }; - - // Methods - - /** - * @brief Class constructor - * - */ - RequestController(const RequestControlerSettings& settings); - - /** - * @brief Class destructor - * - */ - virtual ~RequestController(); - - /** - * @brief Initialize thread pool - * - */ - void InitializeThreadpool(); - - /** - * @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 - * - */ - 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 - * - */ - TResult addHMIRequest(const RequestPtr request); - - /** - * @ 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 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, - bool force_terminate = false); - - /** - * @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); - - - /** - * @brief Removes request from queue - * - * @param mobile_correlation_id Active mobile request correlation ID - * - */ - void OnHMIResponse(const uint32_t& correlation_id); - - /** - * @ 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) - * - */ - void terminateAppRequests(const uint32_t& app_id); - - /** - * @brief Terminates all requests from HMI - */ - void terminateAllHMIRequests(); - - - /** - * @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 - */ - void updateRequestTimeout(const uint32_t& app_id, - const uint32_t& mobile_correlation_id, - const uint32_t& new_timeout); - - /* - * @brief Function Should be called when Low Voltage is occured - */ - void OnLowVoltage(); - - /* - * @brief Function Should be called when Low Voltage is occured - */ - void OnWakeUp(); - - bool IsLowVoltage(); - - protected: - /** - * @brief Timer Callback - */ - void onTimer(); - - /** - * @brief Update timout for next OnTimer - * Not thread safe - */ - void UpdateTimer(); - - void terminateWaitingForExecutionAppRequests(const uint32_t& app_id); - void terminateWaitingForResponseAppRequests(const uint32_t& app_id); - - /** - * @brief Check Posibility to add new requests, or limits was exceeded - * @param request - request to check possipility to Add - * @return True if new request could be added, false otherwise - */ - TResult CheckPosibilitytoAdd(const RequestPtr request); - - /** - * @brief Check Posibility to add new requests, or limits was exceeded - * @param pending_requests_amount - maximum count of request that should be allowed for all applications - * @return True if new request could be added, false otherwise - */ - bool CheckPendingRequestsAmount(const uint32_t& pending_requests_amount); - - private: - class Worker : public threads::ThreadDelegate { - public: - explicit Worker(RequestController* requestController); - virtual ~Worker(); - virtual void threadMain(); - virtual void exitThreadMain(); - protected: - private: - RequestController* request_controller_; - sync_primitives::Lock thread_lock_; - volatile bool stop_flag_; - }; - - std::vector<threads::Thread*> pool_; - volatile TPoolState pool_state_; - uint32_t pool_size_; - sync_primitives::ConditionalVariable cond_var_; - - std::list<RequestPtr> mobile_request_list_; - sync_primitives::Lock mobile_request_list_lock_; - - /* - * Requests, that are waiting for responses - * RequestInfoSet provides correct processing of requests with thre same - * app_id and corr_id - */ - RequestInfoSet waiting_for_response_; - - /** - * @brief Set of HMI notifications with timeout. - */ - std::list<RequestPtr> notification_list_; - - /* - * timer for checking requests timeout - */ - timer::Timer timer_; - - bool is_low_voltage_; - const RequestControlerSettings& settings_; - DISALLOW_COPY_AND_ASSIGN(RequestController); + public: + /** + * @brief Result code for addRequest + */ + enum TResult { + SUCCESS = 0, + TOO_MANY_REQUESTS, + TOO_MANY_PENDING_REQUESTS, + NONE_HMI_LEVEL_MANY_REQUESTS, + INVALID_DATA + }; + + /** + * @brief Thread pool state + */ + enum TPoolState { + UNDEFINED = 0, + STARTED, + STOPPED, + }; + + // Methods + + /** + * @brief Class constructor + * + */ + RequestController(const RequestControlerSettings& settings); + + /** + * @brief Class destructor + * + */ + virtual ~RequestController(); + + /** + * @brief Initialize thread pool + * + */ + void InitializeThreadpool(); + + /** + * @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 + * + */ + 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 + * + */ + TResult addHMIRequest(const RequestPtr request); + + /** + * @ 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 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, + bool force_terminate = false); + + /** + * @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); + + /** + * @brief Removes request from queue + * + * @param mobile_correlation_id Active mobile request correlation ID + * + */ + void OnHMIResponse(const uint32_t& correlation_id); + + /** + * @ 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) + * + */ + void terminateAppRequests(const uint32_t& app_id); + + /** + * @brief Terminates all requests from HMI + */ + void terminateAllHMIRequests(); + + /** + * @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 + */ + void updateRequestTimeout(const uint32_t& app_id, + const uint32_t& mobile_correlation_id, + const uint32_t& new_timeout); + + /* + * @brief Function Should be called when Low Voltage is occured + */ + void OnLowVoltage(); + + /* + * @brief Function Should be called when Low Voltage is occured + */ + void OnWakeUp(); + + bool IsLowVoltage(); + + protected: + /** + * @brief Timer Callback + */ + void onTimer(); + + /** + * @brief Update timout for next OnTimer + * Not thread safe + */ + void UpdateTimer(); + + void terminateWaitingForExecutionAppRequests(const uint32_t& app_id); + void terminateWaitingForResponseAppRequests(const uint32_t& app_id); + + /** + * @brief Check Posibility to add new requests, or limits was exceeded + * @param request - request to check possipility to Add + * @return True if new request could be added, false otherwise + */ + TResult CheckPosibilitytoAdd(const RequestPtr request); + + /** + * @brief Check Posibility to add new requests, or limits was exceeded + * @param pending_requests_amount - maximum count of request that should be + * allowed for all applications + * @return True if new request could be added, false otherwise + */ + bool CheckPendingRequestsAmount(const uint32_t& pending_requests_amount); + + private: + class Worker : public threads::ThreadDelegate { + public: + explicit Worker(RequestController* requestController); + virtual ~Worker(); + virtual void threadMain(); + virtual void exitThreadMain(); + + protected: + private: + RequestController* request_controller_; + sync_primitives::Lock thread_lock_; + volatile bool stop_flag_; + }; + + std::vector<threads::Thread*> pool_; + volatile TPoolState pool_state_; + uint32_t pool_size_; + sync_primitives::ConditionalVariable cond_var_; + + std::list<RequestPtr> mobile_request_list_; + sync_primitives::Lock mobile_request_list_lock_; + + /* + * Requests, that are waiting for responses + * RequestInfoSet provides correct processing of requests with thre same + * app_id and corr_id + */ + RequestInfoSet waiting_for_response_; + + /** + * @brief Set of HMI notifications with timeout. + */ + std::list<RequestPtr> notification_list_; + + /* + * timer for checking requests timeout + */ + timer::Timer timer_; + + bool is_low_voltage_; + const RequestControlerSettings& settings_; + DISALLOW_COPY_AND_ASSIGN(RequestController); }; } // namespace request_controller 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 92dbc0e3f0..853f91ff23 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 @@ -61,10 +61,8 @@ class LastState; * @brief Contains logic for storage/restore data of applications. */ -class ResumeCtrl: public application_manager::event_engine::EventObserver { - +class ResumeCtrl : public application_manager::event_engine::EventObserver { public: - /** * @brief allows to create ResumeCtrl object */ @@ -97,14 +95,16 @@ class ResumeCtrl: public application_manager::event_engine::EventObserver { * @param application is application witch HMI Level is need to restore * @return true if success, otherwise return false */ - bool RestoreAppHMIState(application_manager::ApplicationSharedPtr application); + bool RestoreAppHMIState( + application_manager::ApplicationSharedPtr application); /** * @brief Set application HMI Level as stored in policy * @param application is application witch HMI Level is need to setup * @return true if success, otherwise return false */ - bool SetupDefaultHMILevel(application_manager::ApplicationSharedPtr application); + bool SetupDefaultHMILevel( + application_manager::ApplicationSharedPtr application); /** * @brief Setup HmiLevel for application @@ -124,7 +124,8 @@ class ResumeCtrl: public application_manager::event_engine::EventObserver { * @param application is application witch need to be checked * @return true if exist, false otherwise */ - bool ApplicationIsSaved(application_manager::ApplicationConstSharedPtr application); + bool ApplicationIsSaved( + application_manager::ApplicationConstSharedPtr application); /** * @brief Remove application from list of saved applications @@ -179,7 +180,8 @@ class ResumeCtrl: public application_manager::event_engine::EventObserver { * @param application that is need to be restored * @return true if it was saved, otherwise return false */ - bool StartResumptionOnlyHMILevel(application_manager::ApplicationSharedPtr application); + bool StartResumptionOnlyHMILevel( + application_manager::ApplicationSharedPtr application); /** * @brief Check if there are all files need for resumption @@ -194,8 +196,9 @@ class ResumeCtrl: public application_manager::event_engine::EventObserver { * @param application that is need to be restored * @return true if it was saved, otherwise return false */ - bool CheckApplicationHash(application_manager::ApplicationSharedPtr application, - const std::string& hash); + bool CheckApplicationHash( + application_manager::ApplicationSharedPtr application, + const std::string& hash); /** * @brief Checks if Resume controller have saved application with hmi app id @@ -242,7 +245,8 @@ class ResumeCtrl: public application_manager::event_engine::EventObserver { * @param application - application to restore hmi level * and audio streaming state */ - void StartAppHmiStateResumption(application_manager::ApplicationSharedPtr application); + void StartAppHmiStateResumption( + application_manager::ApplicationSharedPtr application); /** * @brief Update launch_time_ to current @@ -274,7 +278,7 @@ class ResumeCtrl: public application_manager::event_engine::EventObserver { * @return true if initialization is success otherwise * returns false */ - bool Init(LastState &last_state); + bool Init(LastState& last_state); /** * @brief Notify resume controller about new application @@ -298,7 +302,8 @@ class ResumeCtrl: public application_manager::event_engine::EventObserver { * @param application contains application for which restores data * @return true if success, otherwise return false */ - bool RestoreApplicationData(application_manager::ApplicationSharedPtr application); + bool RestoreApplicationData( + application_manager::ApplicationSharedPtr application); /** * @brief AddFiles allows to add files for the application @@ -341,8 +346,9 @@ class ResumeCtrl: public application_manager::event_engine::EventObserver { * @param application application which will be resumed * @param saved_app application specific section from backup file */ - void SetGlobalProperties(application_manager::ApplicationSharedPtr application, - const smart_objects::SmartObject& saved_app); + void SetGlobalProperties( + application_manager::ApplicationSharedPtr application, + const smart_objects::SmartObject& saved_app); /** * @brief AddSubscriptions allows to restore subscriptions @@ -358,16 +364,18 @@ class ResumeCtrl: public application_manager::event_engine::EventObserver { * @param application application which will be resumed * @param saved_app application specific section from backup file */ - void AddWayPointsSubscription(application_manager::ApplicationSharedPtr application, - const smart_objects::SmartObject& saved_app); + void AddWayPointsSubscription( + application_manager::ApplicationSharedPtr application, + const smart_objects::SmartObject& saved_app); bool CheckIgnCycleRestrictions(const smart_objects::SmartObject& saved_app); bool DisconnectedJustBeforeIgnOff( const smart_objects::SmartObject& saved_app); - bool CheckAppRestrictions(application_manager::ApplicationConstSharedPtr application, - const smart_objects::SmartObject& saved_app); + bool CheckAppRestrictions( + application_manager::ApplicationConstSharedPtr application, + const smart_objects::SmartObject& saved_app); /** * @brief CheckIcons allows to check application icons @@ -417,8 +425,9 @@ class ResumeCtrl: public application_manager::event_engine::EventObserver { * @param saved_device_mac Saved device MAC address * @return TRUE on success, otherwise FALSE */ - bool IsDeviceMacAddressEqual(application_manager::ApplicationSharedPtr application, - const std::string& saved_device_mac); + bool IsDeviceMacAddressEqual( + application_manager::ApplicationSharedPtr application, + const std::string& saved_device_mac); /** * @brief Get the last ignition off time from LastState @@ -438,9 +447,8 @@ class ResumeCtrl: public application_manager::event_engine::EventObserver { * @param use_events Process request events or not flag * @return TRUE on success, otherwise FALSE */ - bool ProcessHMIRequest( - smart_objects::SmartObjectSPtr request = NULL, - bool use_events = false); + bool ProcessHMIRequest(smart_objects::SmartObjectSPtr request = NULL, + bool use_events = false); /** * @brief Process list of HMI requests using ProcessHMIRequest method @@ -460,7 +468,7 @@ class ResumeCtrl: public application_manager::event_engine::EventObserver { * @return true, if data resumption must be skipped, otherwise - false */ bool IsAppDataResumptionExpired( - const smart_objects::SmartObject& application) const; + const smart_objects::SmartObject& application) const; /** * @brief Checks from resume data, if application has been disconnected * unexpectedly @@ -475,24 +483,24 @@ class ResumeCtrl: public application_manager::event_engine::EventObserver { * @return true, if no restrictions currently, otherwise - false */ bool IsResumeAllowed( - const application_manager::ApplicationSharedPtr application) const; + const application_manager::ApplicationSharedPtr application) const; /** *@brief Mapping applications to time_stamps * wait for timer to resume HMI Level * */ - mutable sync_primitives::Lock queue_lock_; + mutable sync_primitives::Lock queue_lock_; timer::Timer restore_hmi_level_timer_; timer::Timer save_persistent_data_timer_; - typedef std::list<uint32_t> WaitingForTimerList; - WaitingForTimerList waiting_for_timer_; - bool is_resumption_active_; - bool is_data_saved_; - time_t launch_time_; - utils::SharedPtr<ResumptionData> resumption_storage_; + typedef std::list<uint32_t> WaitingForTimerList; + WaitingForTimerList waiting_for_timer_; + bool is_resumption_active_; + bool is_data_saved_; + time_t launch_time_; + utils::SharedPtr<ResumptionData> resumption_storage_; application_manager::ApplicationManager& application_manager_; }; } // namespace resumption -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_RESUME_CTRL_H +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_RESUME_CTRL_H 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 f75e2c443a..d7fa3968c6 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 @@ -38,7 +38,7 @@ #include "application_manager/application_manager.h" namespace application_manager { - class ApplicationManagerSettings; +class ApplicationManagerSettings; } namespace resumption { @@ -69,8 +69,7 @@ class ResumptionData { * @brief Save application persistent info for future resuming * @param application is application witch need to be saved */ - virtual void SaveApplication( - app_mngr::ApplicationSharedPtr application) = 0; + virtual void SaveApplication(app_mngr::ApplicationSharedPtr application) = 0; /** * @brief Returns HMI level of application from saved data @@ -208,8 +207,8 @@ class ResumptionData { * @brief Persist saves resumption data on file system */ virtual void Persist() = 0; - protected: + protected: /** * @brief Retrieves of commands from application * @param application contains application of which selection commands @@ -287,7 +286,7 @@ class ResumptionData { ++first; } } - mutable sync_primitives::Lock resumption_lock_; + mutable sync_primitives::Lock resumption_lock_; const application_manager::ApplicationManager& application_manager_; }; } // namespace resumption diff --git a/src/components/application_manager/include/application_manager/resumption/resumption_data_db.h b/src/components/application_manager/include/application_manager/resumption/resumption_data_db.h index 7554f1359c..4441b2d4e3 100644 --- a/src/components/application_manager/include/application_manager/resumption/resumption_data_db.h +++ b/src/components/application_manager/include/application_manager/resumption/resumption_data_db.h @@ -42,10 +42,7 @@ namespace resumption { /** * @brief Points what structure contains vr commands */ -enum AccessoryVRCommand { - kVRCommandFromChoice = 0, - kVRCommandFromCommand -}; +enum AccessoryVRCommand { kVRCommandFromChoice = 0, kVRCommandFromCommand }; struct ApplicationParams { ApplicationParams(const smart_objects::SmartObject& application); @@ -89,8 +86,7 @@ class ResumptionDataDB : public ResumptionData { * @brief Save application persistent info for future resuming to db * @param application is application which need to be saved */ - void SaveApplication( - app_mngr::ApplicationSharedPtr application) OVERRIDE; + void SaveApplication(app_mngr::ApplicationSharedPtr application) OVERRIDE; /** * @brief Returns HMI level of application from saved data * @param policy_app_id contains policy id of application @@ -206,7 +202,6 @@ class ResumptionDataDB : public ResumptionData { const std::string& device_id, mobile_apis::HMILevel::eType hmi_level); - /** * @brief Write database to file system */ diff --git a/src/components/application_manager/include/application_manager/resumption/resumption_data_json.h b/src/components/application_manager/include/application_manager/resumption/resumption_data_json.h index 092ac25ea3..1b6eb02776 100644 --- a/src/components/application_manager/include/application_manager/resumption/resumption_data_json.h +++ b/src/components/application_manager/include/application_manager/resumption/resumption_data_json.h @@ -48,8 +48,9 @@ class ResumptionDataJson : public ResumptionData { /** * @brief Constructor of ResumptionDataJson */ - ResumptionDataJson(LastState& last_state, - const application_manager::ApplicationManager& application_manager); + ResumptionDataJson( + LastState& last_state, + const application_manager::ApplicationManager& application_manager); /** * @brief allows to destroy ResumptionDataJson object @@ -185,14 +186,13 @@ class ResumptionDataJson : public ResumptionData { bool DropAppDataResumption(const std::string& device_id, const std::string& app_id) OVERRIDE; - /** * @brief Write json resumption info to file system */ void Persist() OVERRIDE; resumption::LastState& last_state() const { - return last_state_; + return last_state_; } private: 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 e555d50b2f..f2f9fb39a4 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 @@ -47,7 +47,7 @@ namespace application_manager { class StateControllerImpl : public event_engine::EventObserver, - public StateController { + public StateController { public: explicit StateControllerImpl(ApplicationManager& app_mngr); @@ -58,7 +58,8 @@ class StateControllerImpl : public event_engine::EventObserver, * @param state state of new regular state */ - virtual void SetRegularState(ApplicationSharedPtr app, HmiStatePtr state, + virtual void SetRegularState(ApplicationSharedPtr app, + HmiStatePtr state, const bool SendActivateApp); /** @@ -81,8 +82,8 @@ class StateControllerImpl : public event_engine::EventObserver, * @param SendActivateApp: if true, ActivateAppRequest will be sent on HMI */ virtual void SetRegularState(ApplicationSharedPtr app, - const mobile_apis::HMILevel::eType hmi_level, - const bool SendActivateApp); + const mobile_apis::HMILevel::eType hmi_level, + const bool SendActivateApp); /** * @brief SetRegularState Change regular hmi level, audio state and system @@ -107,7 +108,7 @@ class StateControllerImpl : public event_engine::EventObserver, * @param hmi_level new hmi level for application */ virtual void SetRegularState(ApplicationSharedPtr app, - const mobile_apis::HMILevel::eType hmi_level); + const mobile_apis::HMILevel::eType hmi_level); /** * @brief SetRegularState Change regular audio state @@ -164,8 +165,8 @@ class StateControllerImpl : public event_engine::EventObserver, * @param new_state state after change */ virtual void OnStateChanged(ApplicationSharedPtr app, - HmiStatePtr old_state, - HmiStatePtr new_state); + HmiStatePtr old_state, + HmiStatePtr new_state); /** * @brief Checks activity of Deactivate HMI state. @@ -304,7 +305,8 @@ class StateControllerImpl : public event_engine::EventObserver, void TempStateStarted(HmiState::StateID ID); /** - * @brief TempStateStopped remove HMI State ID from StateControllerImpl collection + * @brief TempStateStopped remove HMI State ID from StateControllerImpl + * collection * @param ID state identifier */ void TempStateStopped(HmiState::StateID ID); @@ -441,7 +443,6 @@ class StateControllerImpl : public event_engine::EventObserver, std::map<uint32_t, HmiStatePtr> waiting_for_activate; ApplicationManager& app_mngr_; }; - } #endif // SRC_COMPONENTS_APPLICATION_MANAGER_INCLUDE_APPLICATION_MANAGER_STATE_CONTROLLER_IMPL_H_ diff --git a/src/components/application_manager/src/application_data_impl.cc b/src/components/application_manager/src/application_data_impl.cc index d9aab44b31..a81540708c 100644 --- a/src/components/application_manager/src/application_data_impl.cc +++ b/src/components/application_manager/src/application_data_impl.cc @@ -40,13 +40,12 @@ namespace application_manager { CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager") InitialApplicationDataImpl::InitialApplicationDataImpl() - : app_types_(NULL), - vr_synonyms_(NULL), - tts_name_(NULL), - ngn_media_screen_name_(NULL), - language_(mobile_api::Language::INVALID_ENUM), - ui_language_(mobile_api::Language::INVALID_ENUM) { -} + : app_types_(NULL) + , vr_synonyms_(NULL) + , tts_name_(NULL) + , ngn_media_screen_name_(NULL) + , language_(mobile_api::Language::INVALID_ENUM) + , ui_language_(mobile_api::Language::INVALID_ENUM) {} InitialApplicationDataImpl::~InitialApplicationDataImpl() { if (app_types_) { @@ -70,13 +69,13 @@ InitialApplicationDataImpl::~InitialApplicationDataImpl() { } } -const smart_objects::SmartObject* -InitialApplicationDataImpl::app_types() const { +const smart_objects::SmartObject* InitialApplicationDataImpl::app_types() + const { return app_types_; } -const smart_objects::SmartObject* -InitialApplicationDataImpl::vr_synonyms() const { +const smart_objects::SmartObject* InitialApplicationDataImpl::vr_synonyms() + const { return vr_synonyms_; } @@ -93,13 +92,13 @@ InitialApplicationDataImpl::ngn_media_screen_name() const { return ngn_media_screen_name_; } -const mobile_api::Language::eType& -InitialApplicationDataImpl::language() const { +const mobile_api::Language::eType& InitialApplicationDataImpl::language() + const { return language_; } -const mobile_api::Language::eType& -InitialApplicationDataImpl::ui_language() const { +const mobile_api::Language::eType& InitialApplicationDataImpl::ui_language() + const { return ui_language_; } @@ -153,35 +152,36 @@ void InitialApplicationDataImpl::set_ui_language( ui_language_ = ui_language; } -void InitialApplicationDataImpl::set_perform_interaction_layout(mobile_apis::LayoutMode::eType layout) { +void InitialApplicationDataImpl::set_perform_interaction_layout( + mobile_apis::LayoutMode::eType layout) { perform_interaction_layout_ = layout; } -mobile_apis::LayoutMode::eType InitialApplicationDataImpl::perform_interaction_layout() const { +mobile_apis::LayoutMode::eType +InitialApplicationDataImpl::perform_interaction_layout() const { return perform_interaction_layout_; } DynamicApplicationDataImpl::DynamicApplicationDataImpl() - : help_prompt_(NULL), - timeout_prompt_(NULL), - vr_help_title_(NULL), - vr_help_(NULL), - tbt_state_(mobile_api::TBTState::INVALID_ENUM), - show_command_(NULL), - keyboard_props_(NULL), - menu_title_(NULL), - menu_icon_(NULL), - tbt_show_command_(NULL), - commands_(), - commands_lock_(true), - sub_menu_(), - choice_set_map_(), - performinteraction_choice_set_map_(), - performinteraction_choice_set_lock_(true), - is_perform_interaction_active_(false), - is_reset_global_properties_active_(false), - perform_interaction_mode_(-1) { -} + : help_prompt_(NULL) + , timeout_prompt_(NULL) + , vr_help_title_(NULL) + , vr_help_(NULL) + , tbt_state_(mobile_api::TBTState::INVALID_ENUM) + , show_command_(NULL) + , keyboard_props_(NULL) + , menu_title_(NULL) + , menu_icon_(NULL) + , tbt_show_command_(NULL) + , commands_() + , commands_lock_(true) + , sub_menu_() + , choice_set_map_() + , performinteraction_choice_set_map_() + , performinteraction_choice_set_lock_(true) + , is_perform_interaction_active_(false) + , is_reset_global_properties_active_(false) + , perform_interaction_mode_(-1) {} DynamicApplicationDataImpl::~DynamicApplicationDataImpl() { if (help_prompt_) { @@ -215,82 +215,88 @@ DynamicApplicationDataImpl::~DynamicApplicationDataImpl() { } for (CommandsMap::iterator command_it = commands_.begin(); - commands_.end() != command_it; ++command_it) { + commands_.end() != command_it; + ++command_it) { delete command_it->second; } commands_.clear(); for (SubMenuMap::iterator sub_menu_it = sub_menu_.begin(); - sub_menu_.end() != sub_menu_it; ++sub_menu_it) { + sub_menu_.end() != sub_menu_it; + ++sub_menu_it) { delete sub_menu_it->second; } sub_menu_.clear(); PerformChoiceSetMap::iterator it = performinteraction_choice_set_map_.begin(); for (; performinteraction_choice_set_map_.end() != it; ++it) { - PerformChoice::iterator choice_it = performinteraction_choice_set_map_[it->first].begin(); - for (; performinteraction_choice_set_map_[it->first].end() != choice_it; ++choice_it) { - delete choice_it->second; + PerformChoice::iterator choice_it = + performinteraction_choice_set_map_[it->first].begin(); + for (; performinteraction_choice_set_map_[it->first].end() != choice_it; + ++choice_it) { + delete choice_it->second; } performinteraction_choice_set_map_[it->first].clear(); } performinteraction_choice_set_map_.clear(); } -const smart_objects::SmartObject* -DynamicApplicationDataImpl::help_prompt() const { +const smart_objects::SmartObject* DynamicApplicationDataImpl::help_prompt() + const { return help_prompt_; } -const smart_objects::SmartObject* -DynamicApplicationDataImpl::timeout_prompt() const { +const smart_objects::SmartObject* DynamicApplicationDataImpl::timeout_prompt() + const { return timeout_prompt_; } -const smart_objects::SmartObject* -DynamicApplicationDataImpl::vr_help_title() const { +const smart_objects::SmartObject* DynamicApplicationDataImpl::vr_help_title() + const { return vr_help_title_; } -const smart_objects::SmartObject* -DynamicApplicationDataImpl::vr_help() const { +const smart_objects::SmartObject* DynamicApplicationDataImpl::vr_help() const { return vr_help_; } -const mobile_api::TBTState::eType& -DynamicApplicationDataImpl::tbt_state() const { +const mobile_api::TBTState::eType& DynamicApplicationDataImpl::tbt_state() + const { return tbt_state_; } -const smart_objects::SmartObject* -DynamicApplicationDataImpl::show_command() const { +const smart_objects::SmartObject* DynamicApplicationDataImpl::show_command() + const { return show_command_; } -const smart_objects::SmartObject* -DynamicApplicationDataImpl::tbt_show_command() const { +const smart_objects::SmartObject* DynamicApplicationDataImpl::tbt_show_command() + const { return tbt_show_command_; } -const smart_objects::SmartObject* DynamicApplicationDataImpl::keyboard_props() const { +const smart_objects::SmartObject* DynamicApplicationDataImpl::keyboard_props() + const { return keyboard_props_; } -const smart_objects::SmartObject* DynamicApplicationDataImpl::menu_title() const { +const smart_objects::SmartObject* DynamicApplicationDataImpl::menu_title() + const { return menu_title_; } -const smart_objects::SmartObject* DynamicApplicationDataImpl::menu_icon() const { +const smart_objects::SmartObject* DynamicApplicationDataImpl::menu_icon() + const { return menu_icon_; } void DynamicApplicationDataImpl::load_global_properties( const smart_objects::SmartObject& properties_so) { SetGlobalProperties(properties_so.getElement(strings::vr_help_title), - &DynamicApplicationData::set_vr_help_title); + &DynamicApplicationData::set_vr_help_title); SetGlobalProperties(properties_so.getElement(strings::vr_help), - &DynamicApplicationData::set_vr_help); + &DynamicApplicationData::set_vr_help); SetGlobalProperties(properties_so.getElement(strings::timeout_prompt), &DynamicApplicationData::set_timeout_prompt); @@ -396,16 +402,15 @@ void DynamicApplicationDataImpl::set_menu_icon( if (menu_icon_) { delete menu_icon_; } - menu_icon_= new smart_objects::SmartObject(menu_icon); + menu_icon_ = new smart_objects::SmartObject(menu_icon); } void DynamicApplicationDataImpl::SetGlobalProperties( const smart_objects::SmartObject& param, void (DynamicApplicationData::*callback)( - const NsSmartDeviceLink::NsSmartObjects::SmartObject&)) { - + const NsSmartDeviceLink::NsSmartObjects::SmartObject&)) { smart_objects::SmartType so_type = param.getType(); - if (so_type != smart_objects::SmartType::SmartType_Invalid && + if (so_type != smart_objects::SmartType::SmartType_Invalid && so_type != smart_objects::SmartType::SmartType_Null) { if (callback) { (this->*callback)(param); @@ -416,7 +421,7 @@ void DynamicApplicationDataImpl::SetGlobalProperties( } void DynamicApplicationDataImpl::AddCommand( - uint32_t cmd_id, const smart_objects::SmartObject& command) { + uint32_t cmd_id, const smart_objects::SmartObject& command) { sync_primitives::AutoLock lock(commands_lock_); CommandsMap::const_iterator it = commands_.find(cmd_id); if (commands_.end() == it) { @@ -446,7 +451,7 @@ smart_objects::SmartObject* DynamicApplicationDataImpl::FindCommand( // TODO(VS): Create common functions for processing collections void DynamicApplicationDataImpl::AddSubMenu( - uint32_t menu_id, const smart_objects::SmartObject& menu) { + uint32_t menu_id, const smart_objects::SmartObject& menu) { sync_primitives::AutoLock lock(sub_menu_lock_); SubMenuMap::const_iterator it = sub_menu_.find(menu_id); if (sub_menu_.end() == it) { @@ -478,8 +483,7 @@ smart_objects::SmartObject* DynamicApplicationDataImpl::FindSubMenu( bool DynamicApplicationDataImpl::IsSubMenuNameAlreadyExist( const std::string& name) { sync_primitives::AutoLock lock(sub_menu_lock_); - for (SubMenuMap::iterator it = sub_menu_.begin(); - sub_menu_.end() != it; + for (SubMenuMap::iterator it = sub_menu_.begin(); sub_menu_.end() != it; ++it) { smart_objects::SmartObject* menu = it->second; if ((*menu)[strings::menu_name] == name) { @@ -490,7 +494,7 @@ bool DynamicApplicationDataImpl::IsSubMenuNameAlreadyExist( } void DynamicApplicationDataImpl::AddChoiceSet( - uint32_t choice_set_id, const smart_objects::SmartObject& choice_set) { + uint32_t choice_set_id, const smart_objects::SmartObject& choice_set) { sync_primitives::AutoLock lock(choice_set_map_lock_); ChoiceSetMap::const_iterator it = choice_set_map_.find(choice_set_id); if (choice_set_map_.end() == it) { @@ -520,15 +524,16 @@ smart_objects::SmartObject* DynamicApplicationDataImpl::FindChoiceSet( } void DynamicApplicationDataImpl::AddPerformInteractionChoiceSet( - uint32_t correlation_id, uint32_t choice_set_id, - const smart_objects::SmartObject& vr_commands) { + uint32_t correlation_id, + uint32_t choice_set_id, + const smart_objects::SmartObject& vr_commands) { sync_primitives::AutoLock lock(performinteraction_choice_set_lock_); - performinteraction_choice_set_map_[correlation_id].insert( - std::make_pair(choice_set_id, new smart_objects::SmartObject(vr_commands))); + performinteraction_choice_set_map_[correlation_id].insert(std::make_pair( + choice_set_id, new smart_objects::SmartObject(vr_commands))); } void DynamicApplicationDataImpl::DeletePerformInteractionChoiceSet( - uint32_t correlation_id) { + uint32_t correlation_id) { sync_primitives::AutoLock lock(performinteraction_choice_set_lock_); PerformChoice::iterator it = performinteraction_choice_set_map_[correlation_id].begin(); diff --git a/src/components/application_manager/src/application_impl.cc b/src/components/application_manager/src/application_impl.cc index 4fb8a0e5a5..159a13cf9f 100644 --- a/src/components/application_manager/src/application_impl.cc +++ b/src/components/application_manager/src/application_impl.cc @@ -119,7 +119,6 @@ ApplicationImpl::ApplicationImpl( new ::timer::TimerTaskImpl<ApplicationImpl>( this, &ApplicationImpl::OnAudioStreamSuspend)) , application_manager_(application_manager) { - cmd_number_to_time_limits_[mobile_apis::FunctionID::ReadDIDID] = { date_time::DateTime::getCurrentTime(), 0}; cmd_number_to_time_limits_[mobile_apis::FunctionID::GetVehicleDataID] = { @@ -134,15 +133,16 @@ ApplicationImpl::ApplicationImpl( // load persistent files LoadPersistentFiles(); HmiStatePtr initial_state = application_manager_.CreateRegularState( - app_id(), - mobile_apis::HMILevel::INVALID_ENUM, - mobile_apis::AudioStreamingState::INVALID_ENUM, - mobile_api::SystemContext::SYSCTXT_MAIN); + app_id(), + mobile_apis::HMILevel::INVALID_ENUM, + mobile_apis::AudioStreamingState::INVALID_ENUM, + mobile_api::SystemContext::SYSCTXT_MAIN); state_.InitState(initial_state); - video_stream_suspend_timeout_ = application_manager_.get_settings().video_data_stopped_timeout(); + video_stream_suspend_timeout_ = + application_manager_.get_settings().video_data_stopped_timeout(); audio_stream_suspend_timeout_ = - application_manager_.get_settings().audio_data_stopped_timeout(); + application_manager_.get_settings().audio_data_stopped_timeout(); } ApplicationImpl::~ApplicationImpl() { @@ -268,8 +268,7 @@ const custom_str::CustomString& ApplicationImpl::name() const { return app_name_; } -void ApplicationImpl::set_folder_name( - const std::string& folder_name) { +void ApplicationImpl::set_folder_name(const std::string& folder_name) { folder_name_ = folder_name; } @@ -433,8 +432,7 @@ void ApplicationImpl::StopStreaming( SuspendStreaming(service_type); - if (service_type == ServiceType::kMobileNav && - video_streaming_approved()) { + if (service_type == ServiceType::kMobileNav && video_streaming_approved()) { StopNaviStreaming(); } else if (service_type == ServiceType::kAudio && audio_streaming_approved()) { @@ -451,7 +449,7 @@ void ApplicationImpl::StopNaviStreaming() { } void ApplicationImpl::StopAudioStreaming() { - LOG4CXX_AUTO_TRACE(logger_); + LOG4CXX_AUTO_TRACE(logger_); audio_stream_suspend_timer_.Stop(); MessageHelper::SendAudioStopStream(app_id(), application_manager_); set_audio_streaming_approved(false); @@ -465,14 +463,12 @@ void ApplicationImpl::SuspendStreaming( if (ServiceType::kMobileNav == service_type) { video_stream_suspend_timer_.Stop(); - application_manager_.OnAppStreaming( - app_id(), service_type, false); + application_manager_.OnAppStreaming(app_id(), service_type, false); sync_primitives::AutoLock lock(video_streaming_suspended_lock_); video_streaming_suspended_ = true; } else if (ServiceType::kAudio == service_type) { audio_stream_suspend_timer_.Stop(); - application_manager_.OnAppStreaming( - app_id(), service_type, false); + application_manager_.OnAppStreaming(app_id(), service_type, false); sync_primitives::AutoLock lock(audio_streaming_suspended_lock_); audio_streaming_suspended_ = true; } @@ -487,18 +483,18 @@ void ApplicationImpl::WakeUpStreaming( if (ServiceType::kMobileNav == service_type) { sync_primitives::AutoLock lock(video_streaming_suspended_lock_); if (video_streaming_suspended_) { - application_manager_.OnAppStreaming( - app_id(), service_type, true); - MessageHelper::SendOnDataStreaming(ServiceType::kMobileNav, true, application_manager_); + application_manager_.OnAppStreaming(app_id(), service_type, true); + MessageHelper::SendOnDataStreaming( + ServiceType::kMobileNav, true, application_manager_); video_streaming_suspended_ = false; } video_stream_suspend_timer_.Start(video_stream_suspend_timeout_, false); } else if (ServiceType::kAudio == service_type) { sync_primitives::AutoLock lock(audio_streaming_suspended_lock_); if (audio_streaming_suspended_) { - application_manager_.OnAppStreaming( - app_id(), service_type, true); - MessageHelper::SendOnDataStreaming(ServiceType::kAudio, true, application_manager_); + application_manager_.OnAppStreaming(app_id(), service_type, true); + MessageHelper::SendOnDataStreaming( + ServiceType::kAudio, true, application_manager_); audio_streaming_suspended_ = false; } audio_stream_suspend_timer_.Start(audio_stream_suspend_timeout_, false); @@ -713,11 +709,11 @@ bool ApplicationImpl::IsCommandLimitsExceeded( if (mobile_apis::FunctionID::ReadDIDID == cmd_id) { frequency_restrictions = - application_manager_.get_settings().read_did_frequency(); + application_manager_.get_settings().read_did_frequency(); } else if (mobile_apis::FunctionID::GetVehicleDataID == cmd_id) { frequency_restrictions = - application_manager_.get_settings().get_vehicle_data_frequency(); + application_manager_.get_settings().get_vehicle_data_frequency(); } else { LOG4CXX_INFO(logger_, "No restrictions for request"); return false; @@ -725,18 +721,12 @@ bool ApplicationImpl::IsCommandLimitsExceeded( LOG4CXX_INFO(logger_, "Time Info: " - << "\n Current: " - << current.tv_sec - << "\n Limit: (" - << limit.first.tv_sec - << "," - << limit.second + << "\n Current: " << current.tv_sec << "\n Limit: (" + << limit.first.tv_sec << "," << limit.second << ")" "\n frequency_restrictions: (" - << frequency_restrictions.first - << "," - << frequency_restrictions.second - << ")"); + << frequency_restrictions.first << "," + << frequency_restrictions.second << ")"); if (current.tv_sec < limit.first.tv_sec + frequency_restrictions.second) { if (limit.second < frequency_restrictions.first) { ++limit.second; @@ -822,7 +812,8 @@ void ApplicationImpl::set_is_application_data_changed( void ApplicationImpl::UpdateHash() { LOG4CXX_AUTO_TRACE(logger_); - hash_val_ = utils::gen_hash( application_manager_.get_settings().hash_string_size()); + hash_val_ = + utils::gen_hash(application_manager_.get_settings().hash_string_size()); set_is_application_data_changed(true); MessageHelper::SendHashUpdateNotification(app_id(), application_manager_); @@ -830,7 +821,7 @@ void ApplicationImpl::UpdateHash() { void ApplicationImpl::CleanupFiles() { std::string directory_name = - application_manager_.get_settings().app_storage_folder(); + application_manager_.get_settings().app_storage_folder(); directory_name += "/" + folder_name(); if (file_system::DirectoryExists(directory_name)) { @@ -860,7 +851,7 @@ void ApplicationImpl::LoadPersistentFiles() { if (kWaitingForRegistration == app_state_) { const std::string app_icon_dir( - application_manager_.get_settings().app_icons_folder()); + application_manager_.get_settings().app_icons_folder()); const std::string full_icon_path(app_icon_dir + "/" + mobile_app_id_); if (file_system::FileExists(full_icon_path)) { AppFile file; @@ -898,18 +889,18 @@ void ApplicationImpl::LoadPersistentFiles() { } LOG4CXX_INFO(logger_, - "Loaded persistent file " << file.file_name - << " File type is " - << file.file_type); + "Loaded persistent file " + << file.file_name << " File type is " << file.file_type); AddFile(file); } } } uint32_t ApplicationImpl::GetAvailableDiskSpace() { - const uint32_t app_quota = application_manager_.get_settings().app_dir_quota(); + const uint32_t app_quota = + application_manager_.get_settings().app_dir_quota(); std::string app_storage_path = - application_manager_.get_settings().app_storage_folder(); + application_manager_.get_settings().app_storage_folder(); app_storage_path += "/"; app_storage_path += folder_name(); diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index c021203304..49d7eece3c 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -128,8 +128,7 @@ ApplicationManagerImpl::ApplicationManagerImpl( , application_list_update_timer_( "AM ListUpdater", new TimerTaskImpl<ApplicationManagerImpl>( - this, - &ApplicationManagerImpl::OnApplicationListUpdateTimer)) + this, &ApplicationManagerImpl::OnApplicationListUpdateTimer)) , tts_global_properties_timer_( "AM TTSGLPRTimer", new TimerTaskImpl<ApplicationManagerImpl>( @@ -145,10 +144,9 @@ ApplicationManagerImpl::ApplicationManagerImpl( sync_primitives::AutoLock lock(timer_pool_lock_); TimerSPtr clearing_timer(utils::MakeShared<timer::Timer>( - "ClearTimerPoolTimer", - new TimerTaskImpl<ApplicationManagerImpl>( - this, - &ApplicationManagerImpl::ClearTimerPool))); + "ClearTimerPoolTimer", + new TimerTaskImpl<ApplicationManagerImpl>( + this, &ApplicationManagerImpl::ClearTimerPool))); const uint32_t timeout_ms = 10000u; clearing_timer->Start(timeout_ms, false); timer_pool_.push_back(clearing_timer); @@ -184,15 +182,15 @@ ApplicationManagerImpl::~ApplicationManagerImpl() { template <class UnaryPredicate> ApplicationSharedPtr FindApp(DataAccessor<ApplicationSet> accessor, UnaryPredicate finder) { - ApplicationSet::iterator it = std::find_if( - accessor.GetData().begin(), accessor.GetData().end(), finder); - if (accessor.GetData().end() == it) { - LOG4CXX_DEBUG(logger_, "Unable to find application"); - return ApplicationSharedPtr(); - } - ApplicationSharedPtr app = *it; - LOG4CXX_DEBUG(logger_," Found Application app_id = " << app->app_id()); - return app; + ApplicationSet::iterator it = std::find_if( + accessor.GetData().begin(), accessor.GetData().end(), finder); + if (accessor.GetData().end() == it) { + LOG4CXX_DEBUG(logger_, "Unable to find application"); + return ApplicationSharedPtr(); + } + ApplicationSharedPtr app = *it; + LOG4CXX_DEBUG(logger_, " Found Application app_id = " << app->app_id()); + return app; } template <class UnaryPredicate> @@ -220,7 +218,6 @@ ApplicationSharedPtr ApplicationManagerImpl::application( return FindApp(accessor, finder); } - ApplicationSharedPtr ApplicationManagerImpl::application_by_hmi_app( uint32_t hmi_app_id) const { HmiAppIdPredicate finder(hmi_app_id); @@ -428,8 +425,7 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication( LOG4CXX_DEBUG(logger_, "Restarting application list update timer"); GetPolicyHandler().OnAppsSearchStarted(); - uint32_t timeout = - get_settings().application_list_update_timeout(); + uint32_t timeout = get_settings().application_list_update_timeout(); application_list_update_timer_.Start(timeout, false); if (!is_all_apps_allowed_) { @@ -555,8 +551,7 @@ ApplicationSharedPtr ApplicationManagerImpl::RegisterApplication( applications_.insert(application); applications_list_lock_.Release(); - GetPolicyHandler().AddApplication( - application->policy_app_id()); + GetPolicyHandler().AddApplication(application->policy_app_id()); return application; } @@ -638,15 +633,18 @@ void ApplicationManagerImpl::OnHMIStartedCooperation() { MessageHelper::SendGetSystemInfoRequest(*this); utils::SharedPtr<smart_objects::SmartObject> is_vr_ready( - MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::VR_IsReady, *this)); + MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::VR_IsReady, + *this)); ManageHMICommand(is_vr_ready); utils::SharedPtr<smart_objects::SmartObject> is_tts_ready( - MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::TTS_IsReady, *this)); + MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::TTS_IsReady, + *this)); ManageHMICommand(is_tts_ready); utils::SharedPtr<smart_objects::SmartObject> is_ui_ready( - MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::UI_IsReady, *this)); + MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::UI_IsReady, + *this)); ManageHMICommand(is_ui_ready); utils::SharedPtr<smart_objects::SmartObject> is_navi_ready( @@ -666,7 +664,8 @@ void ApplicationManagerImpl::OnHMIStartedCooperation() { utils::SharedPtr<smart_objects::SmartObject> mixing_audio_supported_request( MessageHelper::CreateModuleInfoSO( - hmi_apis::FunctionID::BasicCommunication_MixingAudioSupported, *this)); + hmi_apis::FunctionID::BasicCommunication_MixingAudioSupported, + *this)); ManageHMICommand(mixing_audio_supported_request); resume_controller().ResetLaunchTime(); } @@ -741,9 +740,7 @@ void ApplicationManagerImpl::StartAudioPassThruThread(int32_t session_key, LOG4CXX_INFO(logger_, "START MICROPHONE RECORDER"); DCHECK_OR_RETURN_VOID(media_manager_); media_manager_->StartMicrophoneRecording( - session_key, - get_settings().recording_file_name(), - max_duration); + session_key, get_settings().recording_file_name(), max_duration); } void ApplicationManagerImpl::SendAudioPassThroughNotification( @@ -893,7 +890,7 @@ void ApplicationManagerImpl::OnDeviceListUpdated( device_info.AdoptDeviceType(dev_params.device_connection_type); GetPolicyHandler().AddDevice(dev_params.device_mac_address, - device_info.connection_type); + device_info.connection_type); } smart_objects::SmartObjectSPtr msg_params = @@ -919,8 +916,7 @@ void ApplicationManagerImpl::OnDeviceListUpdated( void ApplicationManagerImpl::OnFindNewApplicationsRequest() { connection_handler().ConnectToAllDevices(); LOG4CXX_DEBUG(logger_, "Starting application list update timer"); - uint32_t timeout = - get_settings().application_list_update_timeout(); + uint32_t timeout = get_settings().application_list_update_timeout(); application_list_update_timer_.Start(timeout, false); GetPolicyHandler().OnAppsSearchStarted(); } @@ -960,8 +956,7 @@ mobile_apis::HMILevel::eType ApplicationManagerImpl::GetDefaultHmiLevel( if (policy_handler_.PolicyEnabled()) { const std::string policy_app_id = application->policy_app_id(); std::string default_hmi_string = ""; - if (policy_handler_.GetDefaultHmi(policy_app_id, - &default_hmi_string)) { + if (policy_handler_.GetDefaultHmi(policy_app_id, &default_hmi_string)) { if ("BACKGROUND" == default_hmi_string) { default_hmi = HMILevel::HMI_BACKGROUND; } else if ("FULL" == default_hmi_string) { @@ -1005,13 +1000,12 @@ void ApplicationManagerImpl::ReplaceMobileByHMIAppId( smart_objects::SmartObject& message) { MessageHelper::PrintSmartObject(message); if (message.keyExists(strings::app_id)) { - ApplicationSharedPtr application_ptr = application( - message[strings::app_id].asUInt()); + ApplicationSharedPtr application_ptr = + application(message[strings::app_id].asUInt()); if (application_ptr.valid()) { LOG4CXX_DEBUG(logger_, "ReplaceMobileByHMIAppId from " - << message[strings::app_id].asInt() - << " to " + << message[strings::app_id].asInt() << " to " << application_ptr->hmi_app_id()); message[strings::app_id] = application_ptr->hmi_app_id(); } @@ -1042,14 +1036,13 @@ void ApplicationManagerImpl::ReplaceMobileByHMIAppId( void ApplicationManagerImpl::ReplaceHMIByMobileAppId( smart_objects::SmartObject& message) { if (message.keyExists(strings::app_id)) { - ApplicationSharedPtr application = application_by_hmi_app( - message[strings::app_id].asUInt()); + ApplicationSharedPtr application = + application_by_hmi_app(message[strings::app_id].asUInt()); if (application.valid()) { LOG4CXX_DEBUG(logger_, "ReplaceHMIByMobileAppId from " - << message[strings::app_id].asInt() - << " to " + << message[strings::app_id].asInt() << " to " << application->app_id()); message[strings::app_id] = application->app_id(); } @@ -1201,8 +1194,10 @@ void ApplicationManagerImpl::OnServiceEndedCallback( is_resuming = true; is_unexpected_disconnect = false; - ManageMobileCommand(MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( - session_key, AppInterfaceUnregisteredReason::TOO_MANY_REQUESTS), commands::Command::ORIGIN_SDL); + ManageMobileCommand( + MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( + session_key, AppInterfaceUnregisteredReason::TOO_MANY_REQUESTS), + commands::Command::ORIGIN_SDL); break; } case CloseSessionReason::kMalformed: { @@ -1289,7 +1284,8 @@ ApplicationManagerImpl::connection_handler() const { return *connection_handler_; } -protocol_handler::ProtocolHandler& ApplicationManagerImpl::protocol_handler() const { +protocol_handler::ProtocolHandler& ApplicationManagerImpl::protocol_handler() + const { return *protocol_handler_; } @@ -1540,9 +1536,11 @@ bool ApplicationManagerImpl::ManageMobileCommand( "RET Unable to perform request: " << "TOO_MANY_REQUESTS"); - ManageMobileCommand(MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( - connection_key, - mobile_api::AppInterfaceUnregisteredReason::TOO_MANY_REQUESTS), commands::Command::ORIGIN_SDL); + ManageMobileCommand( + MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( + connection_key, + mobile_api::AppInterfaceUnregisteredReason::TOO_MANY_REQUESTS), + commands::Command::ORIGIN_SDL); UnregisterApplication(connection_key, mobile_apis::Result::TOO_MANY_PENDING_REQUESTS, @@ -1558,10 +1556,12 @@ bool ApplicationManagerImpl::ManageMobileCommand( "RET Unable to perform request: " << "REQUEST_WHILE_IN_NONE_HMI_LEVEL"); - ManageMobileCommand(MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( - connection_key, - mobile_api::AppInterfaceUnregisteredReason:: - REQUEST_WHILE_IN_NONE_HMI_LEVEL), commands::Command::ORIGIN_SDL); + ManageMobileCommand( + MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( + connection_key, + mobile_api::AppInterfaceUnregisteredReason:: + REQUEST_WHILE_IN_NONE_HMI_LEVEL), + commands::Command::ORIGIN_SDL); ApplicationSharedPtr app_ptr = application(connection_key); if (app_ptr) { @@ -1667,8 +1667,7 @@ bool ApplicationManagerImpl::ManageHMICommand( bool ApplicationManagerImpl::Init(resumption::LastState& last_state, media_manager::MediaManager* media_manager) { LOG4CXX_TRACE(logger_, "Init application manager"); - const std::string app_storage_folder = - get_settings().app_storage_folder(); + const std::string app_storage_folder = get_settings().app_storage_folder(); if (!InitDirectory(app_storage_folder, TYPE_STORAGE) || !IsReadWriteAllowed(app_storage_folder, TYPE_STORAGE)) { return false; @@ -1686,14 +1685,12 @@ bool ApplicationManagerImpl::Init(resumption::LastState& last_state, return false; } - const std::string system_files_path = - get_settings().system_files_path(); + const std::string system_files_path = get_settings().system_files_path(); if (!InitDirectory(system_files_path, TYPE_SYSTEM) || !IsReadWriteAllowed(system_files_path, TYPE_SYSTEM)) { return false; } - const std::string app_icons_folder = - get_settings().app_icons_folder(); + const std::string app_icons_folder = get_settings().app_icons_folder(); if (!InitDirectory(app_icons_folder, TYPE_ICONS)) { return false; } @@ -2118,11 +2115,12 @@ void ApplicationManagerImpl::PullLanguagesInfo(const SmartObject& app_data, } const HMICapabilities& hmi_cap = hmi_capabilities(); - std::string cur_vr_lang(MessageHelper::CommonLanguageToString - (hmi_cap.active_vr_language())); + std::string cur_vr_lang( + MessageHelper::CommonLanguageToString(hmi_cap.active_vr_language())); const SmartObject& languages = app_data[json::languages]; - std::transform(cur_vr_lang.begin(), cur_vr_lang.end(), cur_vr_lang.begin(), ::toupper); + std::transform( + cur_vr_lang.begin(), cur_vr_lang.end(), cur_vr_lang.begin(), ::toupper); ssize_t default_idx = -1; ssize_t specific_idx = -1; @@ -2130,15 +2128,15 @@ void ApplicationManagerImpl::PullLanguagesInfo(const SmartObject& app_data, const size_t size = languages.length(); for (size_t idx = 0; idx < size; ++idx) { if (languages[idx].keyExists(cur_vr_lang)) { - LOG4CXX_DEBUG(logger_, "Found active HMI language " << cur_vr_lang); - specific_idx = idx; + LOG4CXX_DEBUG(logger_, "Found active HMI language " << cur_vr_lang); + specific_idx = idx; } else if (languages[idx].keyExists(json::default_)) { - LOG4CXX_DEBUG(logger_, "Found default language"); - default_idx = idx; - } + LOG4CXX_DEBUG(logger_, "Found default language"); + default_idx = idx; + } } - if ( (-1 == specific_idx) && (-1 == default_idx) ) { + if ((-1 == specific_idx) && (-1 == default_idx)) { LOG4CXX_DEBUG(logger_, "No suitable language found"); return; } @@ -2180,13 +2178,12 @@ void ApplicationManagerImpl::CreateApplications(SmartArray& obj_array, } const std::string policy_app_id(app_data[json::appId].asString()); - ApplicationSharedPtr registered_app = application_by_policy_id( - policy_app_id); + ApplicationSharedPtr registered_app = + application_by_policy_id(policy_app_id); if (registered_app) { - LOG4CXX_DEBUG( - logger_, - "Application with the same id: " << policy_app_id - << " is registered already."); + LOG4CXX_DEBUG(logger_, + "Application with the same id: " + << policy_app_id << " is registered already."); continue; } @@ -2196,7 +2193,8 @@ void ApplicationManagerImpl::CreateApplications(SmartArray& obj_array, SmartObject vrSynonym; SmartObject ttsName; - const custom_str::CustomString appName(app_data[json::name].asCustomString()); + const custom_str::CustomString appName( + app_data[json::name].asCustomString()); if (app_data.keyExists(json::ios)) { os_type = json::ios; @@ -2222,7 +2220,8 @@ void ApplicationManagerImpl::CreateApplications(SmartArray& obj_array, uint32_t device_id = 0; - if (-1 == connection_handler().GetDataOnSessionKey( + if (-1 == + connection_handler().GetDataOnSessionKey( connection_key, NULL, NULL, &device_id)) { LOG4CXX_ERROR(logger_, "Failed to create application: no connection info."); @@ -2230,11 +2229,8 @@ void ApplicationManagerImpl::CreateApplications(SmartArray& obj_array, } std::string device_mac; - connection_handler().get_session_observer().GetDataOnDeviceID(device_id, - NULL, - NULL, - &device_mac, - NULL); + connection_handler().get_session_observer().GetDataOnDeviceID( + device_id, NULL, NULL, &device_mac, NULL); const uint32_t hmi_app_id = resume_ctrl_.IsApplicationSaved(policy_app_id, device_mac) @@ -2289,7 +2285,8 @@ void ApplicationManagerImpl::ProcessQueryApp( for (; it != apps_to_register_.end(); ++it) { const std::string full_icon_path((*it)->app_icon_path()); if (file_system::FileExists(full_icon_path)) { - MessageHelper::SendSetAppIcon((*it)->hmi_app_id(), full_icon_path, *this); + MessageHelper::SendSetAppIcon( + (*it)->hmi_app_id(), full_icon_path, *this); } } } @@ -2325,8 +2322,7 @@ void ApplicationManagerImpl::updateRequestTimeout( connection_key, mobile_correlation_id, new_timeout_value); } -uint32_t ApplicationManagerImpl::application_id( - const int32_t correlation_id) { +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 = appID_list_.find(correlation_id); @@ -2461,8 +2457,10 @@ void ApplicationManagerImpl::UnregisterAllApplications() { ApplicationSetConstIt it = accessor.GetData().begin(); while (it != accessor.GetData().end()) { ApplicationSharedPtr app_to_remove = *it; - ManageMobileCommand(MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( - app_to_remove->app_id(), unregister_reason_), commands::Command::ORIGIN_SDL); + ManageMobileCommand( + MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( + app_to_remove->app_id(), unregister_reason_), + commands::Command::ORIGIN_SDL); UnregisterApplication(app_to_remove->app_id(), mobile_apis::Result::INVALID_ENUM, is_ignition_off, @@ -2487,7 +2485,8 @@ void ApplicationManagerImpl::RemoveAppsWaitingForRegistration( while (apps_to_register_.end() != it_app) { LOG4CXX_DEBUG(logger_, - "Waiting app: " << (*it_app)->name().c_str() << " is removed."); + "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); @@ -2512,7 +2511,7 @@ void ApplicationManagerImpl::UnregisterApplication( { sync_primitives::AutoLock lock(subscribed_way_points_apps_lock_); subscribed_for_way_points_app_count = - subscribed_way_points_apps_list_.size(); + subscribed_way_points_apps_list_.size(); } if (1 == subscribed_for_way_points_app_count) { LOG4CXX_ERROR(logger_, "Send UnsubscribeWayPoints"); @@ -2581,7 +2580,7 @@ void ApplicationManagerImpl::UnregisterApplication( } applications_.erase(app_to_remove); AppV4DevicePredicate finder(handle); - ApplicationSharedPtr app = FindApp(accessor,finder); + ApplicationSharedPtr app = FindApp(accessor, finder); if (!app) { LOG4CXX_DEBUG( logger_, "There is no more SDL4 apps with device handle: " << handle); @@ -2592,7 +2591,7 @@ void ApplicationManagerImpl::UnregisterApplication( } if (is_resuming) { - resume_ctrl_.SaveApplication(app_to_remove); + resume_ctrl_.SaveApplication(app_to_remove); } else { resume_ctrl_.RemoveApplicationFromSaved(app_to_remove); } @@ -2604,8 +2603,8 @@ void ApplicationManagerImpl::UnregisterApplication( MessageHelper::SendStopAudioPathThru(*this); } - MessageHelper::SendOnAppUnregNotificationToHMI(app_to_remove, - is_unexpected_disconnect, *this); + MessageHelper::SendOnAppUnregNotificationToHMI( + app_to_remove, is_unexpected_disconnect, *this); request_ctrl_.terminateAppRequests(app_id); return; } @@ -2748,10 +2747,10 @@ mobile_apis::Result::eType ApplicationManagerImpl::CheckPolicyPermissions( << stringified_functionID); policy::CheckPermissionResult result; GetPolicyHandler().CheckPermissions(policy_app_id, - stringified_hmi_level, - stringified_functionID, - rpc_params, - result); + stringified_hmi_level, + stringified_functionID, + rpc_params, + result); if (NULL != params_permissions) { params_permissions->allowed_params = result.list_of_allowed_params; @@ -2882,8 +2881,10 @@ void ApplicationManagerImpl::ForbidStreaming(uint32_t app_id) { NaviServiceStatusMap::iterator it = navi_service_status_.find(app_id); if (navi_service_status_.end() == it || (!it->second.first && !it->second.second)) { - ManageMobileCommand(MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( - app_id, PROTOCOL_VIOLATION), commands::Command::ORIGIN_SDL); + ManageMobileCommand( + MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( + app_id, PROTOCOL_VIOLATION), + commands::Command::ORIGIN_SDL); UnregisterApplication(app_id, ABORTED); return; } @@ -2943,10 +2944,9 @@ void ApplicationManagerImpl::EndNaviServices(uint32_t app_id) { navi_app_to_stop_.push_back(app_id); TimerSPtr close_timer(utils::MakeShared<timer::Timer>( - "CloseNaviAppTimer", - new TimerTaskImpl<ApplicationManagerImpl>( - this, - &ApplicationManagerImpl::CloseNaviApp))); + "CloseNaviAppTimer", + new TimerTaskImpl<ApplicationManagerImpl>( + this, &ApplicationManagerImpl::CloseNaviApp))); close_timer->Start(navi_close_app_timeout_, true); sync_primitives::AutoLock lock(timer_pool_lock_); @@ -2985,11 +2985,9 @@ void ApplicationManagerImpl::OnHMILevelChanged( LOG4CXX_TRACE(logger_, "HMILevel from FULL or LIMITED"); navi_app_to_end_stream_.push_back(app_id); TimerSPtr end_stream_timer(utils::MakeShared<timer::Timer>( - "AppShouldFinishStreaming", - new TimerTaskImpl<ApplicationManagerImpl>( - this, - &ApplicationManagerImpl::EndNaviStreaming) - )); + "AppShouldFinishStreaming", + new TimerTaskImpl<ApplicationManagerImpl>( + this, &ApplicationManagerImpl::EndNaviStreaming))); end_stream_timer->Start(navi_end_stream_timeout_, true); sync_primitives::AutoLock lock(timer_pool_lock_); @@ -3063,8 +3061,10 @@ void ApplicationManagerImpl::CloseNaviApp() { if (it->second.first || it->second.second) { LOG4CXX_INFO(logger_, "App haven't answered for EndService. Unregister it."); - ManageMobileCommand(MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( - app_id, PROTOCOL_VIOLATION), commands::Command::ORIGIN_SDL); + ManageMobileCommand( + MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( + app_id, PROTOCOL_VIOLATION), + commands::Command::ORIGIN_SDL); UnregisterApplication(app_id, ABORTED); } } @@ -3133,8 +3133,8 @@ bool ApplicationManagerImpl::IsApplicationForbidden( } policy::DeviceConsent ApplicationManagerImpl::GetUserConsentForDevice( - const std::string& device_id) const { - return policy_handler_.GetUserConsentForDevice(device_id); + const std::string& device_id) const { + return policy_handler_.GetUserConsentForDevice(device_id); } void ApplicationManagerImpl::OnWakeUp() { @@ -3250,7 +3250,8 @@ void ApplicationManagerImpl::OnTimerSendTTSGlobalProperties() { for (uint32_t i = 0; i < app_list.size(); ++i) { LOG4CXX_INFO(logger_, "Send TTS GlobalProperties to HMI with default helpPrompt"); - MessageHelper::SendTTSGlobalProperties(application(app_list[i]), true, *this); + MessageHelper::SendTTSGlobalProperties( + application(app_list[i]), true, *this); RemoveAppFromTTSGlobalPropertiesList(app_list[i]); } } @@ -3259,8 +3260,7 @@ void ApplicationManagerImpl::OnTimerSendTTSGlobalProperties() { void ApplicationManagerImpl::AddAppToTTSGlobalPropertiesList( const uint32_t app_id) { LOG4CXX_AUTO_TRACE(logger_); - uint16_t timeout = - get_settings().tts_global_properties_timeout(); + uint16_t timeout = get_settings().tts_global_properties_timeout(); TimevalStruct current_time = date_time::DateTime::getCurrentTime(); current_time.tv_sec += timeout; // please avoid AutoLock usage to avoid deadlock @@ -3362,7 +3362,9 @@ void ApplicationManagerImpl::OnUpdateHMIAppType( smart_objects::SmartType_Array); bool flag_diffirence_app_hmi_type = false; DataAccessor<ApplicationSet> accessor(applications()); - for (ApplicationSetIt it = accessor.GetData().begin(); it != accessor.GetData().end(); ++it) { + for (ApplicationSetIt it = accessor.GetData().begin(); + it != accessor.GetData().end(); + ++it) { it_app_hmi_types_from_policy = app_hmi_types.find(((*it)->policy_app_id())); if (it_app_hmi_types_from_policy != app_hmi_types.end() && @@ -3401,7 +3403,8 @@ void ApplicationManagerImpl::OnUpdateHMIAppType( } else if (((*it)->hmi_level() == mobile_api::HMILevel::HMI_FULL) || ((*it)->hmi_level() == mobile_api::HMILevel::HMI_LIMITED)) { MessageHelper::SendUIChangeRegistrationRequestToHMI(*it, *this); - state_controller().SetRegularState(*it, mobile_apis::HMILevel::HMI_BACKGROUND, true); + state_controller().SetRegularState( + *it, mobile_apis::HMILevel::HMI_BACKGROUND, true); } } } @@ -3410,7 +3413,7 @@ void ApplicationManagerImpl::OnUpdateHMIAppType( ProtocolVersion ApplicationManagerImpl::SupportedSDLVersion() const { LOG4CXX_AUTO_TRACE(logger_); - bool heart_beat_support = get_settings().heart_beat_timeout(); + bool heart_beat_support = get_settings().heart_beat_timeout(); bool sdl4_support = protocol_handler_->get_settings().enable_protocol_4(); if (sdl4_support) { @@ -3500,7 +3503,8 @@ void ApplicationManagerImpl::SubscribeAppForWayPoints(const uint32_t app_id) { subscribed_way_points_apps_list_.insert(app_id); } -void ApplicationManagerImpl::UnsubscribeAppFromWayPoints(const uint32_t app_id) { +void ApplicationManagerImpl::UnsubscribeAppFromWayPoints( + const uint32_t app_id) { LOG4CXX_AUTO_TRACE(logger_); sync_primitives::AutoLock lock(subscribed_way_points_apps_lock_); subscribed_way_points_apps_list_.erase(app_id); diff --git a/src/components/application_manager/src/commands/command_impl.cc b/src/components/application_manager/src/commands/command_impl.cc index 651432752e..0a3e65a790 100644 --- a/src/components/application_manager/src/commands/command_impl.cc +++ b/src/components/application_manager/src/commands/command_impl.cc @@ -34,7 +34,6 @@ #include "application_manager/application_impl.h" #include "application_manager/application_manager.h" - namespace application_manager { namespace commands { @@ -55,7 +54,7 @@ CommandImpl::~CommandImpl() { CleanUp(); } -bool CommandImpl::CheckPermissions(){ +bool CommandImpl::CheckPermissions() { return true; } @@ -67,8 +66,7 @@ bool CommandImpl::CleanUp() { return true; } -void CommandImpl::Run() { -} +void CommandImpl::Run() {} uint32_t CommandImpl::default_timeout() const { return default_timeout_; @@ -86,23 +84,21 @@ uint32_t CommandImpl::connection_key() const { return (*message_)[strings::params][strings::connection_key].asUInt(); } -void CommandImpl::onTimeOut() { - -} +void CommandImpl::onTimeOut() {} bool CommandImpl::AllowedToTerminate() { - return allowed_to_terminate_; + return allowed_to_terminate_; } void CommandImpl::SetAllowedToTerminate(const bool allowed) { - allowed_to_terminate_ = allowed; + allowed_to_terminate_ = allowed; } void CommandImpl::ReplaceMobileByHMIAppId( NsSmartDeviceLink::NsSmartObjects::SmartObject& message) { if (message.keyExists(strings::app_id)) { - ApplicationSharedPtr application = application_manager_.application( - message[strings::app_id].asUInt()); + ApplicationSharedPtr application = + application_manager_.application(message[strings::app_id].asUInt()); if (application.valid()) { LOG4CXX_DEBUG(logger_, "ReplaceMobileByHMIAppId from " 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 bbb04e4c18..5b44abeec9 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 @@ -38,12 +38,11 @@ namespace application_manager { namespace commands { -CommandNotificationFromMobileImpl::CommandNotificationFromMobileImpl(const MessageSharedPtr& message, ApplicationManager &application_manager) - : CommandImpl(message, application_manager) { -} +CommandNotificationFromMobileImpl::CommandNotificationFromMobileImpl( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : CommandImpl(message, application_manager) {} -CommandNotificationFromMobileImpl::~CommandNotificationFromMobileImpl() { -} +CommandNotificationFromMobileImpl::~CommandNotificationFromMobileImpl() {} bool CommandNotificationFromMobileImpl::Init() { return true; @@ -53,8 +52,7 @@ bool CommandNotificationFromMobileImpl::CleanUp() { return true; } -void CommandNotificationFromMobileImpl::Run() { -} +void CommandNotificationFromMobileImpl::Run() {} void CommandNotificationFromMobileImpl::SendNotification() { (*message_)[strings::params][strings::protocol_type] = mobile_protocol_type_; 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 0f2a2bde24..b6b0e7d500 100644 --- a/src/components/application_manager/src/commands/command_notification_impl.cc +++ b/src/components/application_manager/src/commands/command_notification_impl.cc @@ -42,8 +42,7 @@ CommandNotificationImpl::CommandNotificationImpl( const MessageSharedPtr& message, ApplicationManager& application_manager) : CommandImpl(message, application_manager) {} -CommandNotificationImpl::~CommandNotificationImpl() { -} +CommandNotificationImpl::~CommandNotificationImpl() {} bool CommandNotificationImpl::Init() { return true; @@ -53,8 +52,7 @@ bool CommandNotificationImpl::CleanUp() { return true; } -void CommandNotificationImpl::Run() { -} +void CommandNotificationImpl::Run() {} void CommandNotificationImpl::SendNotification() { (*message_)[strings::params][strings::protocol_type] = mobile_protocol_type_; 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 36627be735..86e3547676 100644 --- a/src/components/application_manager/src/commands/command_request_impl.cc +++ b/src/components/application_manager/src/commands/command_request_impl.cc @@ -44,9 +44,7 @@ namespace commands { struct DisallowedParamsInserter { DisallowedParamsInserter(smart_objects::SmartObject& response, mobile_apis::VehicleDataResultCode::eType code) - : response_(response), - code_(code) { - } + : response_(response), code_(code) {} bool operator()(const std::string& param) { const VehicleData& vehicle_data = @@ -62,7 +60,8 @@ struct DisallowedParamsInserter { } return false; } -private: + + private: smart_objects::SmartObject& response_; mobile_apis::VehicleDataResultCode::eType code_; }; @@ -73,8 +72,7 @@ CommandRequestImpl::CommandRequestImpl(const MessageSharedPtr& message, , EventObserver(application_manager.event_dispatcher()) , current_state_(kAwaitingHMIResponse) {} -CommandRequestImpl::~CommandRequestImpl() { -} +CommandRequestImpl::~CommandRequestImpl() {} bool CommandRequestImpl::Init() { return true; @@ -88,8 +86,7 @@ bool CommandRequestImpl::CleanUp() { return true; } -void CommandRequestImpl::Run() { -} +void CommandRequestImpl::Run() {} void CommandRequestImpl::onTimeOut() { LOG4CXX_AUTO_TRACE(logger_); @@ -108,14 +105,15 @@ void CommandRequestImpl::onTimeOut() { } smart_objects::SmartObjectSPtr response = - MessageHelper::CreateNegativeResponse(connection_key(), function_id(), - correlation_id(), mobile_api::Result::GENERIC_ERROR); + MessageHelper::CreateNegativeResponse(connection_key(), + function_id(), + correlation_id(), + mobile_api::Result::GENERIC_ERROR); application_manager_.ManageMobileCommand(response, ORIGIN_SDL); } -void CommandRequestImpl::on_event(const event_engine::Event& event) { -} +void CommandRequestImpl::on_event(const event_engine::Event& event) {} void CommandRequestImpl::SendResponse( const bool success, @@ -156,12 +154,13 @@ void CommandRequestImpl::SendResponse( response[strings::msg_params][strings::info] = std::string(info); } - // Add disallowed parameters and info from request back to response with appropriate + // Add disallowed parameters and info from request back to response with + // appropriate // reasons (VehicleData result codes) if (result_code != mobile_apis::Result::APPLICATION_NOT_REGISTERED) { const mobile_apis::FunctionID::eType& id = static_cast<mobile_apis::FunctionID::eType>(function_id()); - if ((id == mobile_apis::FunctionID::SubscribeVehicleDataID) || + if ((id == mobile_apis::FunctionID::SubscribeVehicleDataID) || (id == mobile_apis::FunctionID::UnsubscribeVehicleDataID)) { AddDisallowedParameters(response); AddDisallowedParametersToInfo(response); @@ -176,7 +175,8 @@ void CommandRequestImpl::SendResponse( application_manager_.ManageMobileCommand(result, ORIGIN_SDL); } -bool CommandRequestImpl::CheckSyntax(const std::string& str, bool allow_empty_line) { +bool CommandRequestImpl::CheckSyntax(const std::string& str, + bool allow_empty_line) { if (std::string::npos != str.find_first_of("\t\n")) { LOG4CXX_ERROR(logger_, "CheckSyntax failed! :" << str); return false; @@ -196,14 +196,16 @@ bool CommandRequestImpl::CheckSyntax(const std::string& str, bool allow_empty_li uint32_t CommandRequestImpl::SendHMIRequest( const hmi_apis::FunctionID::eType& function_id, - const smart_objects::SmartObject* msg_params, bool use_events) { - + const smart_objects::SmartObject* msg_params, + bool use_events) { smart_objects::SmartObjectSPtr result = new smart_objects::SmartObject; const uint32_t hmi_correlation_id = - application_manager_.GetNextHMICorrelationID(); + application_manager_.GetNextHMICorrelationID(); if (use_events) { - LOG4CXX_DEBUG(logger_, "subscribe_on_event " << function_id << " " << hmi_correlation_id); + LOG4CXX_DEBUG(logger_, + "subscribe_on_event " << function_id << " " + << hmi_correlation_id); subscribe_on_event(function_id, hmi_correlation_id); } @@ -381,7 +383,8 @@ bool CommandRequestImpl::CheckAllowedParameters() { if (connection_key() == (*it_app_list).get()->app_id()) { RPCParams params; - const smart_objects::SmartObject& s_map = (*message_)[strings::msg_params]; + const smart_objects::SmartObject& s_map = + (*message_)[strings::msg_params]; if (smart_objects::SmartType_Map == s_map.getType()) { smart_objects::SmartMap::iterator iter = s_map.map_begin(); smart_objects::SmartMap::iterator iter_end = s_map.map_end(); @@ -396,13 +399,12 @@ bool CommandRequestImpl::CheckAllowedParameters() { CommandParametersPermissions params_permissions; mobile_apis::Result::eType check_result = - application_manager_. - CheckPolicyPermissions( - (*it_app_list).get()->policy_app_id(), - (*it_app_list).get()->hmi_level(), - static_cast<mobile_api::FunctionID::eType>(function_id()), - params, - ¶ms_permissions); + application_manager_.CheckPolicyPermissions( + (*it_app_list).get()->policy_app_id(), + (*it_app_list).get()->hmi_level(), + static_cast<mobile_api::FunctionID::eType>(function_id()), + params, + ¶ms_permissions); // Check, if RPC is allowed by policy if (mobile_apis::Result::SUCCESS != check_result) { @@ -442,13 +444,13 @@ void CommandRequestImpl::RemoveDisallowedParameters( params_permissions.disallowed_params.begin(); std::vector<std::string>::const_iterator it_disallowed_end = params_permissions.disallowed_params.end(); - for (;it_disallowed != it_disallowed_end; ++it_disallowed) { + for (; it_disallowed != it_disallowed_end; ++it_disallowed) { if (params.keyExists(*it_disallowed)) { params.erase(*it_disallowed); - parameters_permissions_.disallowed_params.push_back( - *it_disallowed); - LOG4CXX_INFO(logger_, "Following parameter is disallowed by user: " - << *it_disallowed); + parameters_permissions_.disallowed_params.push_back(*it_disallowed); + LOG4CXX_INFO( + logger_, + "Following parameter is disallowed by user: " << *it_disallowed); } } @@ -457,13 +459,13 @@ void CommandRequestImpl::RemoveDisallowedParameters( params_permissions.undefined_params.begin(); std::vector<std::string>::const_iterator it_undefined_end = params_permissions.undefined_params.end(); - for (;it_undefined != it_undefined_end; ++it_undefined) { + for (; it_undefined != it_undefined_end; ++it_undefined) { if (params.keyExists(*it_undefined)) { params.erase(*it_undefined); - parameters_permissions_.undefined_params.push_back( - *it_undefined); - LOG4CXX_INFO(logger_, "Following parameter is disallowed by policy: " - << *it_undefined); + parameters_permissions_.undefined_params.push_back(*it_undefined); + LOG4CXX_INFO( + logger_, + "Following parameter is disallowed by policy: " << *it_undefined); } } @@ -473,19 +475,18 @@ void CommandRequestImpl::RemoveDisallowedParameters( VehicleData::const_iterator it_vehicle_data = vehicle_data.begin(); VehicleData::const_iterator it_vehicle_data_end = vehicle_data.end(); - for (;it_vehicle_data != it_vehicle_data_end; ++it_vehicle_data) { + for (; it_vehicle_data != it_vehicle_data_end; ++it_vehicle_data) { const std::string key = it_vehicle_data->first; if (params.keyExists(key) && params_permissions.allowed_params.end() == - std::find(params_permissions.allowed_params.begin(), - params_permissions.allowed_params.end(), - key)) { + std::find(params_permissions.allowed_params.begin(), + params_permissions.allowed_params.end(), + key)) { params.erase(key); parameters_permissions_.undefined_params.push_back(key); LOG4CXX_INFO(logger_, "Following parameter is not found among allowed parameters '" - << key - << "' and will be treated as disallowed."); + << key << "' and will be treated as disallowed."); } } } @@ -531,15 +532,13 @@ void CommandRequestImpl::AddDisallowedParametersToInfo( void CommandRequestImpl::AddDisallowedParameters( smart_objects::SmartObject& response) { DisallowedParamsInserter disallowed_inserter( - response, - mobile_apis::VehicleDataResultCode::VDRC_USER_DISALLOWED); + response, mobile_apis::VehicleDataResultCode::VDRC_USER_DISALLOWED); std::for_each(parameters_permissions_.disallowed_params.begin(), parameters_permissions_.disallowed_params.end(), disallowed_inserter); DisallowedParamsInserter undefined_inserter( - response, - mobile_apis::VehicleDataResultCode::VDRC_DISALLOWED); + response, mobile_apis::VehicleDataResultCode::VDRC_DISALLOWED); std::for_each(parameters_permissions_.undefined_params.begin(), parameters_permissions_.undefined_params.end(), undefined_inserter); @@ -547,7 +546,7 @@ void CommandRequestImpl::AddDisallowedParameters( bool CommandRequestImpl::HasDisallowedParams() const { return ((!parameters_permissions_.disallowed_params.empty()) || - (!parameters_permissions_.undefined_params.empty())); + (!parameters_permissions_.undefined_params.empty())); } } // namespace commands diff --git a/src/components/application_manager/src/commands/command_response_impl.cc b/src/components/application_manager/src/commands/command_response_impl.cc index ab027083fc..c3265230a8 100644 --- a/src/components/application_manager/src/commands/command_response_impl.cc +++ b/src/components/application_manager/src/commands/command_response_impl.cc @@ -41,8 +41,7 @@ CommandResponseImpl::CommandResponseImpl( const MessageSharedPtr& message, ApplicationManager& application_manager) : CommandImpl(message, application_manager) {} -CommandResponseImpl::~CommandResponseImpl() { -} +CommandResponseImpl::~CommandResponseImpl() {} bool CommandResponseImpl::Init() { return true; @@ -52,11 +51,12 @@ bool CommandResponseImpl::CleanUp() { return true; } -void CommandResponseImpl::Run() { -} +void CommandResponseImpl::Run() {} void CommandResponseImpl::SendResponse( - bool success, const mobile_apis::Result::eType& result_code, bool final_message) { + bool success, + const mobile_apis::Result::eType& result_code, + bool final_message) { LOG4CXX_INFO(logger_, "Trying to send response"); (*message_)[strings::params][strings::protocol_type] = mobile_protocol_type_; diff --git a/src/components/application_manager/src/commands/hmi/activate_app_request.cc b/src/components/application_manager/src/commands/hmi/activate_app_request.cc index 09d4ae9002..ea36cd2b0a 100644 --- a/src/components/application_manager/src/commands/hmi/activate_app_request.cc +++ b/src/components/application_manager/src/commands/hmi/activate_app_request.cc @@ -36,36 +36,34 @@ namespace application_manager { - namespace commands { +namespace commands { - ActivateAppRequest::ActivateAppRequest( - const MessageSharedPtr& message, ApplicationManager& application_manager): RequestToHMI(message, application_manager) { - } +ActivateAppRequest::ActivateAppRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} +ActivateAppRequest::~ActivateAppRequest() { + LOG4CXX_TRACE(logger_, "~ActivateAppRequest"); +} - ActivateAppRequest::~ActivateAppRequest() { - LOG4CXX_TRACE(logger_, "~ActivateAppRequest"); - } - - void ActivateAppRequest::Run() { - LOG4CXX_TRACE(logger_, "enter " << correlation_id()); - uint32_t app_id = RequestToHMI::application_id(); - application_manager_.set_application_id(correlation_id(), app_id); +void ActivateAppRequest::Run() { + LOG4CXX_TRACE(logger_, "enter " << correlation_id()); + uint32_t app_id = RequestToHMI::application_id(); + application_manager_.set_application_id(correlation_id(), app_id); #ifdef ENABLE_LOG - if ((*message_)[strings::msg_params].keyExists( - strings::activate_app_hmi_level)) { - mobile_apis::HMILevel::eType requested_hmi_level = - static_cast<mobile_apis::HMILevel::eType>( - (*message_)[strings::msg_params][strings::activate_app_hmi_level].asInt()); - LOG4CXX_TRACE(logger_, "requested_hmi_level = " - << requested_hmi_level); - } + if ((*message_)[strings::msg_params].keyExists( + strings::activate_app_hmi_level)) { + mobile_apis::HMILevel::eType requested_hmi_level = + static_cast<mobile_apis::HMILevel::eType>( + (*message_)[strings::msg_params][strings::activate_app_hmi_level] + .asInt()); + LOG4CXX_TRACE(logger_, "requested_hmi_level = " << requested_hmi_level); + } #endif - SendRequest(); - LOG4CXX_TRACE(logger_, "exit"); - } + SendRequest(); + LOG4CXX_TRACE(logger_, "exit"); +} - } // namespace commands +} // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/activate_app_response.cc b/src/components/application_manager/src/commands/hmi/activate_app_response.cc index a667c20190..55e704b6c4 100644 --- a/src/components/application_manager/src/commands/hmi/activate_app_response.cc +++ b/src/components/application_manager/src/commands/hmi/activate_app_response.cc @@ -38,15 +38,15 @@ namespace application_manager { namespace commands { ActivateAppResponse::ActivateAppResponse( - const MessageSharedPtr& message, ApplicationManager& application_manager): ResponseFromHMI(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -ActivateAppResponse::~ActivateAppResponse() { -} +ActivateAppResponse::~ActivateAppResponse() {} void ActivateAppResponse::Run() { LOG4CXX_TRACE(logger_, "enter"); - event_engine::Event event(hmi_apis::FunctionID::BasicCommunication_ActivateApp); + event_engine::Event event( + hmi_apis::FunctionID::BasicCommunication_ActivateApp); event.set_smart_object(*message_); event.raise(application_manager_.event_dispatcher()); LOG4CXX_TRACE(logger_, "exit"); diff --git a/src/components/application_manager/src/commands/hmi/add_statistics_info_notification.cc b/src/components/application_manager/src/commands/hmi/add_statistics_info_notification.cc index 9d0cd89212..ef75eba1e2 100644 --- a/src/components/application_manager/src/commands/hmi/add_statistics_info_notification.cc +++ b/src/components/application_manager/src/commands/hmi/add_statistics_info_notification.cc @@ -40,17 +40,15 @@ namespace commands { AddStatisticsInfoNotification::AddStatisticsInfoNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -AddStatisticsInfoNotification::~AddStatisticsInfoNotification() { -} +AddStatisticsInfoNotification::~AddStatisticsInfoNotification() {} void AddStatisticsInfoNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); int type = (*message_)[strings::msg_params][hmi_notification::statistic_type] - .asInt(); + .asInt(); application_manager_.GetPolicyHandler().AddStatisticsInfo(type); } @@ -58,4 +56,3 @@ void AddStatisticsInfoNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/allow_all_apps_request.cc b/src/components/application_manager/src/commands/hmi/allow_all_apps_request.cc index 768c8b7653..4e096a2cda 100644 --- a/src/components/application_manager/src/commands/hmi/allow_all_apps_request.cc +++ b/src/components/application_manager/src/commands/hmi/allow_all_apps_request.cc @@ -36,12 +36,11 @@ namespace application_manager { namespace commands { -AllowAllAppsRequest::AllowAllAppsRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} +AllowAllAppsRequest::AllowAllAppsRequest( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -AllowAllAppsRequest::~AllowAllAppsRequest() { -} +AllowAllAppsRequest::~AllowAllAppsRequest() {} void AllowAllAppsRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,4 +51,3 @@ void AllowAllAppsRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/allow_all_apps_response.cc b/src/components/application_manager/src/commands/hmi/allow_all_apps_response.cc index cc8248483a..ed05c3ba83 100644 --- a/src/components/application_manager/src/commands/hmi/allow_all_apps_response.cc +++ b/src/components/application_manager/src/commands/hmi/allow_all_apps_response.cc @@ -31,17 +31,15 @@ */ #include "application_manager/commands/hmi/allow_all_apps_response.h" - namespace application_manager { namespace commands { -AllowAllAppsResponse::AllowAllAppsResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} +AllowAllAppsResponse::AllowAllAppsResponse( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -AllowAllAppsResponse::~AllowAllAppsResponse() { -} +AllowAllAppsResponse::~AllowAllAppsResponse() {} void AllowAllAppsResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/allow_app_request.cc b/src/components/application_manager/src/commands/hmi/allow_app_request.cc index 5a66e697a9..5176b3b4fe 100644 --- a/src/components/application_manager/src/commands/hmi/allow_app_request.cc +++ b/src/components/application_manager/src/commands/hmi/allow_app_request.cc @@ -36,12 +36,11 @@ namespace application_manager { namespace commands { -AllowAppRequest::AllowAppRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} +AllowAppRequest::AllowAppRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -AllowAppRequest::~AllowAppRequest() { -} +AllowAppRequest::~AllowAppRequest() {} void AllowAppRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,4 +51,3 @@ void AllowAppRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/allow_app_response.cc b/src/components/application_manager/src/commands/hmi/allow_app_response.cc index a2c7d8fc78..5fd9c702b4 100644 --- a/src/components/application_manager/src/commands/hmi/allow_app_response.cc +++ b/src/components/application_manager/src/commands/hmi/allow_app_response.cc @@ -37,27 +37,26 @@ namespace application_manager { namespace commands { -AllowAppResponse::AllowAppResponse( - const MessageSharedPtr& message, ApplicationManager& application_manager): ResponseFromHMI(message, application_manager) { -} +AllowAppResponse::AllowAppResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -AllowAppResponse::~AllowAppResponse() { -} +AllowAppResponse::~AllowAppResponse() {} void AllowAppResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); uint32_t connection_key = - (*message_)[strings::params][strings::connection_key].asInt(); + (*message_)[strings::params][strings::connection_key].asInt(); - ApplicationSharedPtr app = application_manager_. - application(connection_key); + ApplicationSharedPtr app = application_manager_.application(connection_key); if (!app) { LOG4CXX_ERROR(logger_, "NULL pointer"); return; } - app->set_app_allowed((*message_)[strings::msg_params][hmi_response::allowed].asBool()); + app->set_app_allowed( + (*message_)[strings::msg_params][hmi_response::allowed].asBool()); } } // namespace commands diff --git a/src/components/application_manager/src/commands/hmi/basic_communication_system_request.cc b/src/components/application_manager/src/commands/hmi/basic_communication_system_request.cc index 1e27e01487..2499c21680 100644 --- a/src/components/application_manager/src/commands/hmi/basic_communication_system_request.cc +++ b/src/components/application_manager/src/commands/hmi/basic_communication_system_request.cc @@ -32,17 +32,15 @@ #include "application_manager/commands/hmi/basic_communication_system_request.h" - namespace application_manager { namespace commands { BasicCommunicationSystemRequest::BasicCommunicationSystemRequest( - const MessageSharedPtr& message, ApplicationManager& application_manager): RequestToHMI(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -BasicCommunicationSystemRequest::~BasicCommunicationSystemRequest() { -} +BasicCommunicationSystemRequest::~BasicCommunicationSystemRequest() {} void BasicCommunicationSystemRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,4 +50,3 @@ void BasicCommunicationSystemRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/basic_communication_system_response.cc b/src/components/application_manager/src/commands/hmi/basic_communication_system_response.cc index b33f607310..16afce92e0 100644 --- a/src/components/application_manager/src/commands/hmi/basic_communication_system_response.cc +++ b/src/components/application_manager/src/commands/hmi/basic_communication_system_response.cc @@ -39,15 +39,15 @@ namespace application_manager { namespace commands { BasicCommunicationSystemResponse::BasicCommunicationSystemResponse( - const MessageSharedPtr& message, ApplicationManager& application_manager): ResponseFromHMI(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -BasicCommunicationSystemResponse::~BasicCommunicationSystemResponse() { -} +BasicCommunicationSystemResponse::~BasicCommunicationSystemResponse() {} void BasicCommunicationSystemResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); - event_engine::Event event(hmi_apis::FunctionID::BasicCommunication_SystemRequest); + event_engine::Event event( + hmi_apis::FunctionID::BasicCommunication_SystemRequest); event.set_smart_object(*message_); event.raise(application_manager_.event_dispatcher()); } diff --git a/src/components/application_manager/src/commands/hmi/button_get_capabilities_request.cc b/src/components/application_manager/src/commands/hmi/button_get_capabilities_request.cc index 622323a6e9..e6b73879e5 100644 --- a/src/components/application_manager/src/commands/hmi/button_get_capabilities_request.cc +++ b/src/components/application_manager/src/commands/hmi/button_get_capabilities_request.cc @@ -39,11 +39,9 @@ namespace commands { ButtonGetCapabilitiesRequest::ButtonGetCapabilitiesRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} + : RequestToHMI(message, application_manager) {} -ButtonGetCapabilitiesRequest::~ButtonGetCapabilitiesRequest() { -} +ButtonGetCapabilitiesRequest::~ButtonGetCapabilitiesRequest() {} void ButtonGetCapabilitiesRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -54,4 +52,3 @@ void ButtonGetCapabilitiesRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/button_get_capabilities_response.cc b/src/components/application_manager/src/commands/hmi/button_get_capabilities_response.cc index 711040ff60..a947fb7ba9 100644 --- a/src/components/application_manager/src/commands/hmi/button_get_capabilities_response.cc +++ b/src/components/application_manager/src/commands/hmi/button_get_capabilities_response.cc @@ -39,11 +39,9 @@ namespace commands { ButtonGetCapabilitiesResponse::ButtonGetCapabilitiesResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} + : ResponseFromHMI(message, application_manager) {} -ButtonGetCapabilitiesResponse::~ButtonGetCapabilitiesResponse() { -} +ButtonGetCapabilitiesResponse::~ButtonGetCapabilitiesResponse() {} void ButtonGetCapabilitiesResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -56,8 +54,7 @@ void ButtonGetCapabilitiesResponse::Run() { return; } - HMICapabilities& hmi_capabilities = - application_manager_.hmi_capabilities(); + HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities(); hmi_capabilities.set_button_capabilities( (*message_)[strings::msg_params][hmi_response::capabilities]); diff --git a/src/components/application_manager/src/commands/hmi/close_popup_request.cc b/src/components/application_manager/src/commands/hmi/close_popup_request.cc index d366aa408b..b0ab48dd96 100644 --- a/src/components/application_manager/src/commands/hmi/close_popup_request.cc +++ b/src/components/application_manager/src/commands/hmi/close_popup_request.cc @@ -36,12 +36,11 @@ namespace application_manager { namespace commands { -ClosePopupRequest::ClosePopupRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} +ClosePopupRequest::ClosePopupRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -ClosePopupRequest::~ClosePopupRequest() { -} +ClosePopupRequest::~ClosePopupRequest() {} void ClosePopupRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,4 +51,3 @@ void ClosePopupRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/close_popup_response.cc b/src/components/application_manager/src/commands/hmi/close_popup_response.cc index f3dd63becd..15adb2ee32 100644 --- a/src/components/application_manager/src/commands/hmi/close_popup_response.cc +++ b/src/components/application_manager/src/commands/hmi/close_popup_response.cc @@ -35,12 +35,11 @@ namespace application_manager { namespace commands { -ClosePopupResponse::ClosePopupResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} +ClosePopupResponse::ClosePopupResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -ClosePopupResponse::~ClosePopupResponse() { -} +ClosePopupResponse::~ClosePopupResponse() {} void ClosePopupResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/dial_number_request.cc b/src/components/application_manager/src/commands/hmi/dial_number_request.cc index 8297e56a71..b26541cb01 100644 --- a/src/components/application_manager/src/commands/hmi/dial_number_request.cc +++ b/src/components/application_manager/src/commands/hmi/dial_number_request.cc @@ -38,20 +38,18 @@ namespace commands { namespace hmi { -DialNumberRequest::DialNumberRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} +DialNumberRequest::DialNumberRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -DialNumberRequest::~DialNumberRequest() { -} +DialNumberRequest::~DialNumberRequest() {} void DialNumberRequest::Run() { SendRequest(); } -} // namespace hmi +} // namespace hmi } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/dial_number_response.cc b/src/components/application_manager/src/commands/hmi/dial_number_response.cc index ab54651552..5511fa98f8 100644 --- a/src/components/application_manager/src/commands/hmi/dial_number_response.cc +++ b/src/components/application_manager/src/commands/hmi/dial_number_response.cc @@ -31,27 +31,26 @@ */ #include "application_manager/commands/hmi/dial_number_response.h" - namespace application_manager { namespace commands { namespace hmi { -DialNumberResponse::DialNumberResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} +DialNumberResponse::DialNumberResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -DialNumberResponse::~DialNumberResponse() { -} +DialNumberResponse::~DialNumberResponse() {} void DialNumberResponse::Run() { - event_engine::Event event(hmi_apis::FunctionID::BasicCommunication_DialNumber); + event_engine::Event event( + hmi_apis::FunctionID::BasicCommunication_DialNumber); event.set_smart_object(*message_); event.raise(application_manager_.event_dispatcher()); } -} // namespace hmi +} // namespace hmi } // namespace commands diff --git a/src/components/application_manager/src/commands/hmi/get_system_info_request.cc b/src/components/application_manager/src/commands/hmi/get_system_info_request.cc index c7004ec436..379027c43a 100644 --- a/src/components/application_manager/src/commands/hmi/get_system_info_request.cc +++ b/src/components/application_manager/src/commands/hmi/get_system_info_request.cc @@ -32,17 +32,15 @@ #include "application_manager/commands/hmi/get_system_info_request.h" - namespace application_manager { namespace commands { GetSystemInfoRequest::GetSystemInfoRequest( - const MessageSharedPtr& message, ApplicationManager& application_manager): RequestToHMI(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -GetSystemInfoRequest::~GetSystemInfoRequest() { -} +GetSystemInfoRequest::~GetSystemInfoRequest() {} void GetSystemInfoRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -55,5 +53,3 @@ void GetSystemInfoRequest::Run() { } // namespace commands } // namespace application_manager - - diff --git a/src/components/application_manager/src/commands/hmi/get_system_info_response.cc b/src/components/application_manager/src/commands/hmi/get_system_info_response.cc index 93b108e04d..be6dabb292 100644 --- a/src/components/application_manager/src/commands/hmi/get_system_info_response.cc +++ b/src/components/application_manager/src/commands/hmi/get_system_info_response.cc @@ -36,8 +36,8 @@ namespace application_manager { namespace commands { GetSystemInfoResponse::GetSystemInfoResponse( - const MessageSharedPtr& message, ApplicationManager& application_manager): ResponseFromHMI(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} GetSystemInfoResponse::~GetSystemInfoResponse() {} @@ -69,7 +69,8 @@ const SystemInfo GetSystemInfoResponse::GetSystemInfo( info.wers_country_code = (*message_)[strings::msg_params]["wersCountryCode"].asString(); - const uint32_t lang_code = (*message_)[strings::msg_params]["language"].asUInt(); + const uint32_t lang_code = + (*message_)[strings::msg_params]["language"].asUInt(); info.language = application_manager::MessageHelper::CommonLanguageToString( static_cast<hmi_apis::Common_Language::eType>(lang_code)); diff --git a/src/components/application_manager/src/commands/hmi/get_urls.cc b/src/components/application_manager/src/commands/hmi/get_urls.cc index ee831104ce..1b11cdb040 100644 --- a/src/components/application_manager/src/commands/hmi/get_urls.cc +++ b/src/components/application_manager/src/commands/hmi/get_urls.cc @@ -38,12 +38,11 @@ namespace application_manager { namespace commands { -GetUrls::GetUrls(const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestFromHMI(message, application_manager) { -} +GetUrls::GetUrls(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : RequestFromHMI(message, application_manager) {} -GetUrls::~GetUrls() { -} +GetUrls::~GetUrls() {} void GetUrls::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,12 +51,13 @@ void GetUrls::Run() { if (application_manager_.GetPolicyHandler().PolicyEnabled()) { policy::EndpointUrls endpoints; application_manager_.GetPolicyHandler().GetServiceUrls( - object[strings::msg_params][hmi_request::service].asString(), endpoints); + object[strings::msg_params][hmi_request::service].asString(), + endpoints); if (!endpoints.empty()) { object[strings::msg_params].erase(hmi_request::service); object[strings::msg_params][hmi_response::urls] = - smart_objects::SmartObject(smart_objects::SmartType_Array); + smart_objects::SmartObject(smart_objects::SmartType_Array); smart_objects::SmartObject& urls = object[strings::msg_params][hmi_response::urls]; @@ -68,14 +68,13 @@ void GetUrls::Run() { for (size_t k = 0; k < endpoints[i].url.size(); ++k, ++index) { const std::string url = endpoints[i].url[k]; - urls[index] = smart_objects::SmartObject( - smart_objects::SmartType_Map); + urls[index] = + smart_objects::SmartObject(smart_objects::SmartType_Map); smart_objects::SmartObject& service_info = urls[index]; service_info[strings::url] = url; if (policy::kDefaultId != endpoints[i].app_id) { - service_info[hmi_response::policy_app_id] = - endpoints[i].app_id; + service_info[hmi_response::policy_app_id] = endpoints[i].app_id; } } } diff --git a/src/components/application_manager/src/commands/hmi/get_urls_response.cc b/src/components/application_manager/src/commands/hmi/get_urls_response.cc index 4b8ebde050..dd9686fbce 100644 --- a/src/components/application_manager/src/commands/hmi/get_urls_response.cc +++ b/src/components/application_manager/src/commands/hmi/get_urls_response.cc @@ -32,16 +32,14 @@ #include "application_manager/commands/hmi/get_urls_response.h" - namespace application_manager { namespace commands { -GetUrlsResponse::GetUrlsResponse( - const MessageSharedPtr& message, ApplicationManager& application_manager): ResponseToHMI(message, application_manager) { -} +GetUrlsResponse::GetUrlsResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : ResponseToHMI(message, application_manager) {} -GetUrlsResponse::~GetUrlsResponse() { -} +GetUrlsResponse::~GetUrlsResponse() {} void GetUrlsResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/mixing_audio_supported_request.cc b/src/components/application_manager/src/commands/hmi/mixing_audio_supported_request.cc index 194b6e9d28..e38d1fc088 100644 --- a/src/components/application_manager/src/commands/hmi/mixing_audio_supported_request.cc +++ b/src/components/application_manager/src/commands/hmi/mixing_audio_supported_request.cc @@ -37,11 +37,10 @@ namespace application_manager { namespace commands { MixingAudioSupportedRequest::MixingAudioSupportedRequest( - const MessageSharedPtr& message, ApplicationManager& application_manager) : RequestToHMI(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -MixingAudioSupportedRequest::~MixingAudioSupportedRequest() { -} +MixingAudioSupportedRequest::~MixingAudioSupportedRequest() {} void MixingAudioSupportedRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,4 +51,3 @@ void MixingAudioSupportedRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/mixing_audio_supported_response.cc b/src/components/application_manager/src/commands/hmi/mixing_audio_supported_response.cc index a9da74170c..f8b58e6f35 100644 --- a/src/components/application_manager/src/commands/hmi/mixing_audio_supported_response.cc +++ b/src/components/application_manager/src/commands/hmi/mixing_audio_supported_response.cc @@ -31,25 +31,23 @@ */ #include "application_manager/commands/hmi/mixing_audio_supported_response.h" - namespace application_manager { namespace commands { MixingAudioSupportedResponse::MixingAudioSupportedResponse( - const MessageSharedPtr& message, ApplicationManager& application_manager) : ResponseFromHMI(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -MixingAudioSupportedResponse::~MixingAudioSupportedResponse() { -} +MixingAudioSupportedResponse::~MixingAudioSupportedResponse() {} void MixingAudioSupportedResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); - HMICapabilities& hmi_capabilities = - application_manager_.hmi_capabilities(); - hmi_capabilities.set_attenuated_supported((*message_) - [strings::msg_params][hmi_response::attenuated_supported].asBool()); + HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities(); + hmi_capabilities.set_attenuated_supported( + (*message_)[strings::msg_params][hmi_response::attenuated_supported] + .asBool()); } } // namespace commands diff --git a/src/components/application_manager/src/commands/hmi/navi_alert_maneuver_request.cc b/src/components/application_manager/src/commands/hmi/navi_alert_maneuver_request.cc index e431cb6376..582caaa8f3 100644 --- a/src/components/application_manager/src/commands/hmi/navi_alert_maneuver_request.cc +++ b/src/components/application_manager/src/commands/hmi/navi_alert_maneuver_request.cc @@ -37,11 +37,10 @@ namespace application_manager { namespace commands { NaviAlertManeuverRequest::NaviAlertManeuverRequest( - const MessageSharedPtr& message, ApplicationManager& application_manager) : RequestToHMI(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -NaviAlertManeuverRequest::~NaviAlertManeuverRequest() { -} +NaviAlertManeuverRequest::~NaviAlertManeuverRequest() {} void NaviAlertManeuverRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,4 +51,3 @@ void NaviAlertManeuverRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/navi_alert_maneuver_response.cc b/src/components/application_manager/src/commands/hmi/navi_alert_maneuver_response.cc index d8e3807eb9..5f0422bf6a 100644 --- a/src/components/application_manager/src/commands/hmi/navi_alert_maneuver_response.cc +++ b/src/components/application_manager/src/commands/hmi/navi_alert_maneuver_response.cc @@ -39,11 +39,10 @@ namespace application_manager { namespace commands { NaviAlertManeuverResponse::NaviAlertManeuverResponse( - const MessageSharedPtr& message, ApplicationManager& application_manager) : ResponseFromHMI(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -NaviAlertManeuverResponse::~NaviAlertManeuverResponse() { -} +NaviAlertManeuverResponse::~NaviAlertManeuverResponse() {} void NaviAlertManeuverResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/navi_audio_start_stream_request.cc b/src/components/application_manager/src/commands/hmi/navi_audio_start_stream_request.cc index 25ef2a24d1..920c6fbdf9 100644 --- a/src/components/application_manager/src/commands/hmi/navi_audio_start_stream_request.cc +++ b/src/components/application_manager/src/commands/hmi/navi_audio_start_stream_request.cc @@ -35,27 +35,26 @@ #include "application_manager/message_helper.h" #include "protocol_handler/protocol_handler.h" - namespace application_manager { namespace commands { AudioStartStreamRequest::AudioStartStreamRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager), - EventObserver(application_manager.event_dispatcher()), - retry_number_(0) { + : RequestToHMI(message, application_manager) + , EventObserver(application_manager.event_dispatcher()) + , retry_number_(0) { LOG4CXX_AUTO_TRACE(logger_); std::pair<uint32_t, int32_t> stream_retry = application_manager_.get_settings().start_stream_retry_amount(); default_timeout_ = stream_retry.second; retry_number_ = stream_retry.first; - LOG4CXX_DEBUG(logger_, "default_timeout_ = " << default_timeout_ - <<"; retry_number_ = " << retry_number_); + LOG4CXX_DEBUG(logger_, + "default_timeout_ = " << default_timeout_ + << "; retry_number_ = " << retry_number_); } -AudioStartStreamRequest::~AudioStartStreamRequest() { -} +AudioStartStreamRequest::~AudioStartStreamRequest() {} void AudioStartStreamRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -64,14 +63,15 @@ void AudioStartStreamRequest::Run() { subscribe_on_event(hmi_apis::FunctionID::Navigation_StartAudioStream, correlation_id()); - ApplicationSharedPtr app = application_manager_. - application_by_hmi_app(application_id()); + ApplicationSharedPtr app = + application_manager_.application_by_hmi_app(application_id()); if (app) { app->set_audio_streaming_allowed(true); SendRequest(); } else { - LOG4CXX_ERROR(logger_, "Applcation with hmi_app_id " - << application_id() << " does not exist"); + LOG4CXX_ERROR(logger_, + "Applcation with hmi_app_id " << application_id() + << " does not exist"); } } @@ -79,11 +79,11 @@ void AudioStartStreamRequest::on_event(const event_engine::Event& event) { using namespace protocol_handler; LOG4CXX_AUTO_TRACE(logger_); - ApplicationSharedPtr app = application_manager_. - application_by_hmi_app(application_id()); + ApplicationSharedPtr app = + application_manager_.application_by_hmi_app(application_id()); if (!app) { LOG4CXX_ERROR(logger_, - "StartAudioStreamRequest aborted. Application not found"); + "StartAudioStreamRequest aborted. Application not found"); return; } @@ -98,12 +98,13 @@ void AudioStartStreamRequest::on_event(const event_engine::Event& event) { if (hmi_apis::Common_Result::SUCCESS == code) { LOG4CXX_INFO(logger_, "StartAudioStream response SUCCESS"); - if (application_manager_. - HMILevelAllowsStreaming(app->app_id(), ServiceType::kAudio)) { + if (application_manager_.HMILevelAllowsStreaming(app->app_id(), + ServiceType::kAudio)) { app->set_audio_streaming_approved(true); } else { - LOG4CXX_WARN(logger_, - "StartAudioStreamRequest aborted. Application can not stream"); + LOG4CXX_WARN( + logger_, + "StartAudioStreamRequest aborted. Application can not stream"); } break; } @@ -114,7 +115,7 @@ void AudioStartStreamRequest::on_event(const event_engine::Event& event) { } } default: { - LOG4CXX_ERROR(logger_,"Received unknown event" << event.id()); + LOG4CXX_ERROR(logger_, "Received unknown event" << event.id()); return; } } @@ -123,18 +124,17 @@ void AudioStartStreamRequest::on_event(const event_engine::Event& event) { void AudioStartStreamRequest::onTimeOut() { RetryStartSession(); - application_manager_.TerminateRequest( - connection_key(), correlation_id()); + application_manager_.TerminateRequest(connection_key(), correlation_id()); } void AudioStartStreamRequest::RetryStartSession() { LOG4CXX_AUTO_TRACE(logger_); - ApplicationSharedPtr app = application_manager_. - application_by_hmi_app(application_id()); + ApplicationSharedPtr app = + application_manager_.application_by_hmi_app(application_id()); if (!app) { LOG4CXX_ERROR(logger_, - "StartAudioStreamRequest aborted. Application not found"); + "StartAudioStreamRequest aborted. Application not found"); return; } @@ -144,21 +144,24 @@ void AudioStartStreamRequest::RetryStartSession() { } if (app->audio_streaming_approved()) { - LOG4CXX_INFO(logger_, "AudioStartStream retry sequence stopped. " - << "SUCCESS received"); + LOG4CXX_INFO(logger_, + "AudioStartStream retry sequence stopped. " + << "SUCCESS received"); app->set_audio_stream_retry_number(0); return; } - uint32_t curr_retry_number = app->audio_stream_retry_number(); + uint32_t curr_retry_number = app->audio_stream_retry_number(); if (curr_retry_number < retry_number_ - 1) { - LOG4CXX_DEBUG(logger_, "Send AudioStartStream retry. retry_number = " - << curr_retry_number); + LOG4CXX_DEBUG( + logger_, + "Send AudioStartStream retry. retry_number = " << curr_retry_number); MessageHelper::SendAudioStartStream(app->app_id(), application_manager_); app->set_audio_stream_retry_number(++curr_retry_number); } else { - LOG4CXX_DEBUG(logger_, "Audio start stream retry sequence stopped. " - << "Attempts expired."); + LOG4CXX_DEBUG(logger_, + "Audio start stream retry sequence stopped. " + << "Attempts expired."); application_manager_.EndNaviServices(app->app_id()); } diff --git a/src/components/application_manager/src/commands/hmi/navi_audio_start_stream_response.cc b/src/components/application_manager/src/commands/hmi/navi_audio_start_stream_response.cc index 5e3098d1c4..c7fc7365e7 100644 --- a/src/components/application_manager/src/commands/hmi/navi_audio_start_stream_response.cc +++ b/src/components/application_manager/src/commands/hmi/navi_audio_start_stream_response.cc @@ -31,17 +31,15 @@ */ #include "application_manager/commands/hmi/navi_audio_start_stream_response.h" - namespace application_manager { namespace commands { -AudioStartStreamResponse::AudioStartStreamResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} +AudioStartStreamResponse::AudioStartStreamResponse( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -AudioStartStreamResponse::~AudioStartStreamResponse() { -} +AudioStartStreamResponse::~AudioStartStreamResponse() {} void AudioStartStreamResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_request.cc b/src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_request.cc index fac42d66f0..d0f1a96282 100644 --- a/src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_request.cc +++ b/src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_request.cc @@ -37,11 +37,9 @@ namespace commands { AudioStopStreamRequest::AudioStopStreamRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} + : RequestToHMI(message, application_manager) {} -AudioStopStreamRequest::~AudioStopStreamRequest() { -} +AudioStopStreamRequest::~AudioStopStreamRequest() {} void AudioStopStreamRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_response.cc b/src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_response.cc index 7f7d3cbfa3..c669d399f9 100644 --- a/src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_response.cc +++ b/src/components/application_manager/src/commands/hmi/navi_audio_stop_stream_response.cc @@ -35,16 +35,14 @@ namespace application_manager { namespace commands { -AudioStopStreamResponse::AudioStopStreamResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} +AudioStopStreamResponse::AudioStopStreamResponse( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -AudioStopStreamResponse::~AudioStopStreamResponse() { -} +AudioStopStreamResponse::~AudioStopStreamResponse() {} void AudioStopStreamResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); - } } // namespace commands diff --git a/src/components/application_manager/src/commands/hmi/navi_get_way_points_response.cc b/src/components/application_manager/src/commands/hmi/navi_get_way_points_response.cc index 0b449d9ac5..f295845b24 100644 --- a/src/components/application_manager/src/commands/hmi/navi_get_way_points_response.cc +++ b/src/components/application_manager/src/commands/hmi/navi_get_way_points_response.cc @@ -39,7 +39,7 @@ namespace application_manager { namespace commands { NaviGetWayPointsResponse::NaviGetWayPointsResponse( - const MessageSharedPtr &message, ApplicationManager& application_manager) + const MessageSharedPtr& message, ApplicationManager& application_manager) : ResponseFromHMI(message, application_manager) {} NaviGetWayPointsResponse::~NaviGetWayPointsResponse() {} @@ -47,8 +47,7 @@ NaviGetWayPointsResponse::~NaviGetWayPointsResponse() {} void NaviGetWayPointsResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); - event_engine::Event event( - hmi_apis::FunctionID::Navigation_GetWayPoints); + event_engine::Event event(hmi_apis::FunctionID::Navigation_GetWayPoints); event.set_smart_object(*message_); event.raise(application_manager_.event_dispatcher()); } diff --git a/src/components/application_manager/src/commands/hmi/navi_is_ready_request.cc b/src/components/application_manager/src/commands/hmi/navi_is_ready_request.cc index d48a204008..92e972e8f4 100644 --- a/src/components/application_manager/src/commands/hmi/navi_is_ready_request.cc +++ b/src/components/application_manager/src/commands/hmi/navi_is_ready_request.cc @@ -36,12 +36,11 @@ namespace application_manager { namespace commands { -NaviIsReadyRequest::NaviIsReadyRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} +NaviIsReadyRequest::NaviIsReadyRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -NaviIsReadyRequest::~NaviIsReadyRequest() { -} +NaviIsReadyRequest::~NaviIsReadyRequest() {} void NaviIsReadyRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,4 +51,3 @@ void NaviIsReadyRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/navi_is_ready_response.cc b/src/components/application_manager/src/commands/hmi/navi_is_ready_response.cc index 2b4a838ebe..129900c60f 100644 --- a/src/components/application_manager/src/commands/hmi/navi_is_ready_response.cc +++ b/src/components/application_manager/src/commands/hmi/navi_is_ready_response.cc @@ -31,17 +31,15 @@ */ #include "application_manager/commands/hmi/navi_is_ready_response.h" - namespace application_manager { namespace commands { -NaviIsReadyResponse::NaviIsReadyResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} +NaviIsReadyResponse::NaviIsReadyResponse( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -NaviIsReadyResponse::~NaviIsReadyResponse() { -} +NaviIsReadyResponse::~NaviIsReadyResponse() {} void NaviIsReadyResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,8 +50,7 @@ void NaviIsReadyResponse::Run() { is_available = object[strings::msg_params][strings::available].asBool(); } - HMICapabilities& hmi_capabilities = - application_manager_.hmi_capabilities(); + HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities(); hmi_capabilities.set_is_navi_cooperating(is_available); } diff --git a/src/components/application_manager/src/commands/hmi/navi_send_location_request.cc b/src/components/application_manager/src/commands/hmi/navi_send_location_request.cc index 2b9ffe1bcf..ad878033ca 100644 --- a/src/components/application_manager/src/commands/hmi/navi_send_location_request.cc +++ b/src/components/application_manager/src/commands/hmi/navi_send_location_request.cc @@ -36,12 +36,11 @@ namespace application_manager { namespace commands { -NaviSendLocationRequest::NaviSendLocationRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} +NaviSendLocationRequest::NaviSendLocationRequest( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -NaviSendLocationRequest::~NaviSendLocationRequest() { -} +NaviSendLocationRequest::~NaviSendLocationRequest() {} void NaviSendLocationRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,4 +51,3 @@ void NaviSendLocationRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/navi_send_location_response.cc b/src/components/application_manager/src/commands/hmi/navi_send_location_response.cc index 2126dd5a99..a3d9f4c9e5 100644 --- a/src/components/application_manager/src/commands/hmi/navi_send_location_response.cc +++ b/src/components/application_manager/src/commands/hmi/navi_send_location_response.cc @@ -32,17 +32,15 @@ #include "application_manager/commands/hmi/navi_send_location_response.h" #include "application_manager/event_engine/event.h" - namespace application_manager { namespace commands { -NaviSendLocationResponse::NaviSendLocationResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} +NaviSendLocationResponse::NaviSendLocationResponse( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -NaviSendLocationResponse::~NaviSendLocationResponse() { -} +NaviSendLocationResponse::~NaviSendLocationResponse() {} void NaviSendLocationResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/navi_show_constant_tbt_request.cc b/src/components/application_manager/src/commands/hmi/navi_show_constant_tbt_request.cc index 551220a832..a92ef07d12 100644 --- a/src/components/application_manager/src/commands/hmi/navi_show_constant_tbt_request.cc +++ b/src/components/application_manager/src/commands/hmi/navi_show_constant_tbt_request.cc @@ -37,11 +37,10 @@ namespace application_manager { namespace commands { NaviShowConstantTBTRequest::NaviShowConstantTBTRequest( - const MessageSharedPtr& message, ApplicationManager& application_manager) : RequestToHMI(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -NaviShowConstantTBTRequest::~NaviShowConstantTBTRequest() { -} +NaviShowConstantTBTRequest::~NaviShowConstantTBTRequest() {} void NaviShowConstantTBTRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,4 +51,3 @@ void NaviShowConstantTBTRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/navi_show_constant_tbt_response.cc b/src/components/application_manager/src/commands/hmi/navi_show_constant_tbt_response.cc index 221403bf6c..ede3272e8e 100644 --- a/src/components/application_manager/src/commands/hmi/navi_show_constant_tbt_response.cc +++ b/src/components/application_manager/src/commands/hmi/navi_show_constant_tbt_response.cc @@ -39,11 +39,10 @@ namespace application_manager { namespace commands { NaviShowConstantTBTResponse::NaviShowConstantTBTResponse( - const MessageSharedPtr& message, ApplicationManager& application_manager) : ResponseFromHMI(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -NaviShowConstantTBTResponse::~NaviShowConstantTBTResponse() { -} +NaviShowConstantTBTResponse::~NaviShowConstantTBTResponse() {} void NaviShowConstantTBTResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/navi_start_stream_request.cc b/src/components/application_manager/src/commands/hmi/navi_start_stream_request.cc index 71a129c2d7..f0104cbaee 100644 --- a/src/components/application_manager/src/commands/hmi/navi_start_stream_request.cc +++ b/src/components/application_manager/src/commands/hmi/navi_start_stream_request.cc @@ -35,27 +35,26 @@ #include "application_manager/message_helper.h" #include "protocol_handler/protocol_handler.h" - namespace application_manager { namespace commands { NaviStartStreamRequest::NaviStartStreamRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager), - EventObserver(application_manager.event_dispatcher()), - retry_number_(0) { + : RequestToHMI(message, application_manager) + , EventObserver(application_manager.event_dispatcher()) + , retry_number_(0) { LOG4CXX_AUTO_TRACE(logger_); std::pair<uint32_t, int32_t> stream_retry = application_manager_.get_settings().start_stream_retry_amount(); default_timeout_ = stream_retry.second; retry_number_ = stream_retry.first; - LOG4CXX_DEBUG(logger_, "default_timeout_ = " << default_timeout_ - <<"; retry_number_ = " << retry_number_); + LOG4CXX_DEBUG(logger_, + "default_timeout_ = " << default_timeout_ + << "; retry_number_ = " << retry_number_); } -NaviStartStreamRequest::~NaviStartStreamRequest() { -} +NaviStartStreamRequest::~NaviStartStreamRequest() {} void NaviStartStreamRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -64,14 +63,15 @@ void NaviStartStreamRequest::Run() { subscribe_on_event(hmi_apis::FunctionID::Navigation_StartStream, correlation_id()); - ApplicationSharedPtr app = application_manager_. - application_by_hmi_app(application_id()); + ApplicationSharedPtr app = + application_manager_.application_by_hmi_app(application_id()); if (app) { app->set_video_streaming_allowed(true); SendRequest(); } else { - LOG4CXX_ERROR(logger_, "Applcation with hmi_app_id " - << application_id() << "does not exist"); + LOG4CXX_ERROR(logger_, + "Applcation with hmi_app_id " << application_id() + << "does not exist"); } } @@ -79,11 +79,11 @@ void NaviStartStreamRequest::on_event(const event_engine::Event& event) { using namespace protocol_handler; LOG4CXX_AUTO_TRACE(logger_); - ApplicationSharedPtr app = application_manager_. - application_by_hmi_app(application_id()); + ApplicationSharedPtr app = + application_manager_.application_by_hmi_app(application_id()); if (!app) { LOG4CXX_ERROR(logger_, - "NaviStartStreamRequest aborted. Application not found"); + "NaviStartStreamRequest aborted. Application not found"); return; } @@ -98,12 +98,13 @@ void NaviStartStreamRequest::on_event(const event_engine::Event& event) { if (hmi_apis::Common_Result::SUCCESS == code) { LOG4CXX_INFO(logger_, "NaviStartStreamResponse SUCCESS"); - if (application_manager_. - HMILevelAllowsStreaming(app->app_id(), ServiceType::kMobileNav)) { + if (application_manager_.HMILevelAllowsStreaming( + app->app_id(), ServiceType::kMobileNav)) { app->set_video_streaming_approved(true); } else { - LOG4CXX_DEBUG(logger_, - "NaviStartStreamRequest aborted. Application can not stream"); + LOG4CXX_DEBUG( + logger_, + "NaviStartStreamRequest aborted. Application can not stream"); } break; } @@ -114,7 +115,7 @@ void NaviStartStreamRequest::on_event(const event_engine::Event& event) { } } default: { - LOG4CXX_ERROR(logger_,"Received unknown event" << event.id()); + LOG4CXX_ERROR(logger_, "Received unknown event" << event.id()); return; } } @@ -123,18 +124,17 @@ void NaviStartStreamRequest::on_event(const event_engine::Event& event) { void NaviStartStreamRequest::onTimeOut() { RetryStartSession(); - application_manager_.TerminateRequest( - connection_key(), correlation_id()); + application_manager_.TerminateRequest(connection_key(), correlation_id()); } void NaviStartStreamRequest::RetryStartSession() { LOG4CXX_AUTO_TRACE(logger_); - ApplicationSharedPtr app = application_manager_. - application_by_hmi_app(application_id()); + ApplicationSharedPtr app = + application_manager_.application_by_hmi_app(application_id()); if (!app) { LOG4CXX_ERROR(logger_, - "NaviStartStreamRequest aborted. Application not found"); + "NaviStartStreamRequest aborted. Application not found"); return; } @@ -144,21 +144,24 @@ void NaviStartStreamRequest::RetryStartSession() { } if (app->video_streaming_approved()) { - LOG4CXX_INFO(logger_, "NaviStartStream retry sequence stopped. " - << "SUCCESS received"); + LOG4CXX_INFO(logger_, + "NaviStartStream retry sequence stopped. " + << "SUCCESS received"); app->set_video_stream_retry_number(0); return; } uint32_t curr_retry_number = app->video_stream_retry_number(); if (curr_retry_number < retry_number_ - 1) { - LOG4CXX_DEBUG(logger_, "Send NaviStartStream retry. retry_number = " - << curr_retry_number); + LOG4CXX_DEBUG( + logger_, + "Send NaviStartStream retry. retry_number = " << curr_retry_number); MessageHelper::SendNaviStartStream(app->app_id(), application_manager_); app->set_video_stream_retry_number(++curr_retry_number); } else { - LOG4CXX_DEBUG(logger_, "NaviStartStream retry sequence stopped. " - << "Attempts expired"); + LOG4CXX_DEBUG(logger_, + "NaviStartStream retry sequence stopped. " + << "Attempts expired"); application_manager_.EndNaviServices(app->app_id()); } diff --git a/src/components/application_manager/src/commands/hmi/navi_start_stream_response.cc b/src/components/application_manager/src/commands/hmi/navi_start_stream_response.cc index 02efc77e1e..b0b9e672c3 100644 --- a/src/components/application_manager/src/commands/hmi/navi_start_stream_response.cc +++ b/src/components/application_manager/src/commands/hmi/navi_start_stream_response.cc @@ -31,17 +31,15 @@ */ #include "application_manager/commands/hmi/navi_start_stream_response.h" - namespace application_manager { namespace commands { -NaviStartStreamResponse::NaviStartStreamResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} +NaviStartStreamResponse::NaviStartStreamResponse( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -NaviStartStreamResponse::~NaviStartStreamResponse() { -} +NaviStartStreamResponse::~NaviStartStreamResponse() {} void NaviStartStreamResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/navi_stop_stream_request.cc b/src/components/application_manager/src/commands/hmi/navi_stop_stream_request.cc index 0c72f24845..4b72ff28b4 100644 --- a/src/components/application_manager/src/commands/hmi/navi_stop_stream_request.cc +++ b/src/components/application_manager/src/commands/hmi/navi_stop_stream_request.cc @@ -6,11 +6,9 @@ namespace commands { NaviStopStreamRequest::NaviStopStreamRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} + : RequestToHMI(message, application_manager) {} -NaviStopStreamRequest::~NaviStopStreamRequest() { -} +NaviStopStreamRequest::~NaviStopStreamRequest() {} void NaviStopStreamRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/navi_stop_stream_response.cc b/src/components/application_manager/src/commands/hmi/navi_stop_stream_response.cc index a10eb5d325..3a7fc75260 100644 --- a/src/components/application_manager/src/commands/hmi/navi_stop_stream_response.cc +++ b/src/components/application_manager/src/commands/hmi/navi_stop_stream_response.cc @@ -35,16 +35,14 @@ namespace application_manager { namespace commands { -NaviStopStreamResponse::NaviStopStreamResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} +NaviStopStreamResponse::NaviStopStreamResponse( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -NaviStopStreamResponse::~NaviStopStreamResponse() { -} +NaviStopStreamResponse::~NaviStopStreamResponse() {} void NaviStopStreamResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); - } } // namespace commands diff --git a/src/components/application_manager/src/commands/hmi/navi_subscribe_way_points_response.cc b/src/components/application_manager/src/commands/hmi/navi_subscribe_way_points_response.cc index 0f5ebfb1a2..f641051560 100644 --- a/src/components/application_manager/src/commands/hmi/navi_subscribe_way_points_response.cc +++ b/src/components/application_manager/src/commands/hmi/navi_subscribe_way_points_response.cc @@ -39,7 +39,7 @@ namespace application_manager { namespace commands { NaviSubscribeWayPointsResponse::NaviSubscribeWayPointsResponse( - const MessageSharedPtr &message, ApplicationManager& application_manager) + const MessageSharedPtr& message, ApplicationManager& application_manager) : ResponseFromHMI(message, application_manager) {} NaviSubscribeWayPointsResponse::~NaviSubscribeWayPointsResponse() {} diff --git a/src/components/application_manager/src/commands/hmi/navi_unsubscribe_way_points_response.cc b/src/components/application_manager/src/commands/hmi/navi_unsubscribe_way_points_response.cc index a0c82135d9..61216321e8 100644 --- a/src/components/application_manager/src/commands/hmi/navi_unsubscribe_way_points_response.cc +++ b/src/components/application_manager/src/commands/hmi/navi_unsubscribe_way_points_response.cc @@ -40,7 +40,7 @@ namespace application_manager { namespace commands { NaviUnsubscribeWayPointsResponse::NaviUnsubscribeWayPointsResponse( - const MessageSharedPtr &message, ApplicationManager& application_manager) + const MessageSharedPtr& message, ApplicationManager& application_manager) : ResponseFromHMI(message, application_manager) {} NaviUnsubscribeWayPointsResponse::~NaviUnsubscribeWayPointsResponse() {} diff --git a/src/components/application_manager/src/commands/hmi/navi_update_turn_list_request.cc b/src/components/application_manager/src/commands/hmi/navi_update_turn_list_request.cc index dd0e8a78f4..c37c3d12f9 100644 --- a/src/components/application_manager/src/commands/hmi/navi_update_turn_list_request.cc +++ b/src/components/application_manager/src/commands/hmi/navi_update_turn_list_request.cc @@ -37,11 +37,10 @@ namespace application_manager { namespace commands { NaviUpdateTurnListRequest::NaviUpdateTurnListRequest( - const MessageSharedPtr& message, ApplicationManager& application_manager) : RequestToHMI(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -NaviUpdateTurnListRequest::~NaviUpdateTurnListRequest() { -} +NaviUpdateTurnListRequest::~NaviUpdateTurnListRequest() {} void NaviUpdateTurnListRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,4 +51,3 @@ void NaviUpdateTurnListRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/navi_update_turn_list_response.cc b/src/components/application_manager/src/commands/hmi/navi_update_turn_list_response.cc index c932e6756d..faf5719d05 100644 --- a/src/components/application_manager/src/commands/hmi/navi_update_turn_list_response.cc +++ b/src/components/application_manager/src/commands/hmi/navi_update_turn_list_response.cc @@ -39,11 +39,10 @@ namespace application_manager { namespace commands { NaviUpdateTurnListResponse::NaviUpdateTurnListResponse( - const MessageSharedPtr& message, ApplicationManager& application_manager) : ResponseFromHMI(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -NaviUpdateTurnListResponse::~NaviUpdateTurnListResponse() { -} +NaviUpdateTurnListResponse::~NaviUpdateTurnListResponse() {} void NaviUpdateTurnListResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/notification_from_hmi.cc b/src/components/application_manager/src/commands/hmi/notification_from_hmi.cc index 831d0dcc89..64eb63fde8 100644 --- a/src/components/application_manager/src/commands/hmi/notification_from_hmi.cc +++ b/src/components/application_manager/src/commands/hmi/notification_from_hmi.cc @@ -45,8 +45,7 @@ NotificationFromHMI::NotificationFromHMI( ReplaceHMIByMobileAppId(*message); } -NotificationFromHMI::~NotificationFromHMI() { -} +NotificationFromHMI::~NotificationFromHMI() {} bool NotificationFromHMI::Init() { return true; @@ -56,12 +55,10 @@ bool NotificationFromHMI::CleanUp() { return true; } -void NotificationFromHMI::Run() { -} +void NotificationFromHMI::Run() {} void NotificationFromHMI::SendNotificationToMobile( const MessageSharedPtr& message) { - (*message)[strings::params][strings::message_type] = static_cast<int32_t>(application_manager::MessageType::kNotification); application_manager_.ManageMobileCommand(message, ORIGIN_SDL); @@ -70,7 +67,6 @@ void NotificationFromHMI::SendNotificationToMobile( void NotificationFromHMI::CreateHMIRequest( const hmi_apis::FunctionID::eType& function_id, const smart_objects::SmartObject& msg_params) const { - smart_objects::SmartObjectSPtr result = new smart_objects::SmartObject; if (!result) { LOG4CXX_ERROR(logger_, "Memory allocation failed."); @@ -78,7 +74,8 @@ void NotificationFromHMI::CreateHMIRequest( } // get hmi correlation id for chaining further request from this object - const uint32_t hmi_correlation_id_ = application_manager_.GetNextHMICorrelationID(); + const uint32_t hmi_correlation_id_ = + application_manager_.GetNextHMICorrelationID(); NsSmartDeviceLink::NsSmartObjects::SmartObject& request = *result; request[strings::params][strings::message_type] = diff --git a/src/components/application_manager/src/commands/hmi/notification_to_hmi.cc b/src/components/application_manager/src/commands/hmi/notification_to_hmi.cc index 635b0c8ac0..f1e933b7ef 100644 --- a/src/components/application_manager/src/commands/hmi/notification_to_hmi.cc +++ b/src/components/application_manager/src/commands/hmi/notification_to_hmi.cc @@ -44,8 +44,7 @@ NotificationToHMI::NotificationToHMI(const MessageSharedPtr& message, ReplaceMobileByHMIAppId(*(message.get())); } -NotificationToHMI::~NotificationToHMI() { -} +NotificationToHMI::~NotificationToHMI() {} bool NotificationToHMI::Init() { return true; @@ -55,8 +54,7 @@ bool NotificationToHMI::CleanUp() { return true; } -void NotificationToHMI::Run() { -} +void NotificationToHMI::Run() {} void NotificationToHMI::SendNotification() { (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_; diff --git a/src/components/application_manager/src/commands/hmi/on_allow_sdl_functionality_notification.cc b/src/components/application_manager/src/commands/hmi/on_allow_sdl_functionality_notification.cc index 28e185d9da..70e5e7cefd 100644 --- a/src/components/application_manager/src/commands/hmi/on_allow_sdl_functionality_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_allow_sdl_functionality_notification.cc @@ -40,8 +40,7 @@ namespace commands { OnAllowSDLFunctionalityNotification::OnAllowSDLFunctionalityNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} OnAllowSDLFunctionalityNotification::~OnAllowSDLFunctionalityNotification() {} @@ -49,8 +48,7 @@ void OnAllowSDLFunctionalityNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); std::string device_id; if ((*message_)[strings::msg_params].keyExists("device")) { - device_id = (*message_)[strings::msg_params]["device"]["id"] - .asString(); + device_id = (*message_)[strings::msg_params]["device"]["id"].asString(); } application_manager_.GetPolicyHandler().OnAllowSDLFunctionalityNotification( (*message_)[strings::msg_params][hmi_response::allowed].asBool(), diff --git a/src/components/application_manager/src/commands/hmi/on_app_activated_notification.cc b/src/components/application_manager/src/commands/hmi/on_app_activated_notification.cc index fdbb6169ca..76252a50fd 100644 --- a/src/components/application_manager/src/commands/hmi/on_app_activated_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_app_activated_notification.cc @@ -41,15 +41,14 @@ namespace commands { OnAppActivatedNotification::OnAppActivatedNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnAppActivatedNotification::~OnAppActivatedNotification() { -} +OnAppActivatedNotification::~OnAppActivatedNotification() {} void OnAppActivatedNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); - event_engine::Event event(hmi_apis::FunctionID::BasicCommunication_OnAppActivated); + event_engine::Event event( + hmi_apis::FunctionID::BasicCommunication_OnAppActivated); event.set_smart_object(*message_); event.raise(application_manager_.event_dispatcher()); } @@ -57,4 +56,3 @@ void OnAppActivatedNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_app_deactivated_notification.cc b/src/components/application_manager/src/commands/hmi/on_app_deactivated_notification.cc index e3ee21c77e..86ce6a830c 100644 --- a/src/components/application_manager/src/commands/hmi/on_app_deactivated_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_app_deactivated_notification.cc @@ -43,15 +43,14 @@ namespace commands { OnAppDeactivatedNotification::OnAppDeactivatedNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnAppDeactivatedNotification::~OnAppDeactivatedNotification() { -} +OnAppDeactivatedNotification::~OnAppDeactivatedNotification() {} void OnAppDeactivatedNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); - event_engine::Event event(hmi_apis::FunctionID::BasicCommunication_OnAppDeactivated); + event_engine::Event event( + hmi_apis::FunctionID::BasicCommunication_OnAppDeactivated); event.set_smart_object(*message_); event.raise(application_manager_.event_dispatcher()); } diff --git a/src/components/application_manager/src/commands/hmi/on_app_permission_changed_notification.cc b/src/components/application_manager/src/commands/hmi/on_app_permission_changed_notification.cc index a5f4ced9a5..fa7293513a 100644 --- a/src/components/application_manager/src/commands/hmi/on_app_permission_changed_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_app_permission_changed_notification.cc @@ -38,11 +38,9 @@ namespace commands { OnAppPermissionChangedNotification::OnAppPermissionChangedNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationToHMI(message, application_manager) { -} + : NotificationToHMI(message, application_manager) {} -OnAppPermissionChangedNotification::~OnAppPermissionChangedNotification() { -} +OnAppPermissionChangedNotification::~OnAppPermissionChangedNotification() {} void OnAppPermissionChangedNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/on_app_permission_consent_notification.cc b/src/components/application_manager/src/commands/hmi/on_app_permission_consent_notification.cc index 7cc5133ba2..0efc1aee8a 100644 --- a/src/components/application_manager/src/commands/hmi/on_app_permission_consent_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_app_permission_consent_notification.cc @@ -40,12 +40,11 @@ namespace application_manager { namespace commands { -OnAppPermissionConsentNotification::OnAppPermissionConsentNotification(const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} +OnAppPermissionConsentNotification::OnAppPermissionConsentNotification( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : NotificationFromHMI(message, application_manager) {} -OnAppPermissionConsentNotification::~OnAppPermissionConsentNotification() { -} +OnAppPermissionConsentNotification::~OnAppPermissionConsentNotification() {} void OnAppPermissionConsentNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -81,11 +80,10 @@ void OnAppPermissionConsentNotification::Run() { permission_consent.group_permissions.push_back(permissions); } - permission_consent.consent_source = - msg_params["source"].asString(); + permission_consent.consent_source = msg_params["source"].asString(); - application_manager_.GetPolicyHandler().OnAppPermissionConsent(connection_key, - permission_consent); + application_manager_.GetPolicyHandler().OnAppPermissionConsent( + connection_key, permission_consent); } } diff --git a/src/components/application_manager/src/commands/hmi/on_app_registered_notification.cc b/src/components/application_manager/src/commands/hmi/on_app_registered_notification.cc index 944917d90b..a97e19b556 100644 --- a/src/components/application_manager/src/commands/hmi/on_app_registered_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_app_registered_notification.cc @@ -32,24 +32,23 @@ #include "application_manager/commands/hmi/on_app_registered_notification.h" - namespace application_manager { namespace commands { OnAppRegisteredNotification::OnAppRegisteredNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager) : NotificationToHMI(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : NotificationToHMI(message, application_manager) {} -OnAppRegisteredNotification::~OnAppRegisteredNotification() { -} +OnAppRegisteredNotification::~OnAppRegisteredNotification() {} void OnAppRegisteredNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); // SDL must notify system about app registration before any dependent actions // will be started SendNotification(); - event_engine::Event event(hmi_apis::FunctionID::BasicCommunication_OnAppRegistered); + event_engine::Event event( + hmi_apis::FunctionID::BasicCommunication_OnAppRegistered); event.set_smart_object(*message_); event.raise(application_manager_.event_dispatcher()); } @@ -57,4 +56,3 @@ void OnAppRegisteredNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_app_unregistered_notification.cc b/src/components/application_manager/src/commands/hmi/on_app_unregistered_notification.cc index 1b22a3ec38..10ea1ea303 100644 --- a/src/components/application_manager/src/commands/hmi/on_app_unregistered_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_app_unregistered_notification.cc @@ -39,17 +39,17 @@ namespace application_manager { namespace commands { OnAppUnregisteredNotification::OnAppUnregisteredNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager) : NotificationToHMI(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : NotificationToHMI(message, application_manager) {} -OnAppUnregisteredNotification::~OnAppUnregisteredNotification() { -} +OnAppUnregisteredNotification::~OnAppUnregisteredNotification() {} void OnAppUnregisteredNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); - //sending event for delete VRCommand on PerformInteraction - event_engine::Event event(hmi_apis::FunctionID::BasicCommunication_OnAppUnregistered); + // sending event for delete VRCommand on PerformInteraction + event_engine::Event event( + hmi_apis::FunctionID::BasicCommunication_OnAppUnregistered); event.set_smart_object(*message_); event.raise(application_manager_.event_dispatcher()); @@ -59,4 +59,3 @@ void OnAppUnregisteredNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_audio_data_streaming_notification.cc b/src/components/application_manager/src/commands/hmi/on_audio_data_streaming_notification.cc index 76cf3c9199..c3e81bdc30 100644 --- a/src/components/application_manager/src/commands/hmi/on_audio_data_streaming_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_audio_data_streaming_notification.cc @@ -38,11 +38,9 @@ namespace commands { OnAudioDataStreamingNotification::OnAudioDataStreamingNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationToHMI(message, application_manager) { -} + : NotificationToHMI(message, application_manager) {} -OnAudioDataStreamingNotification::~OnAudioDataStreamingNotification() { -} +OnAudioDataStreamingNotification::~OnAudioDataStreamingNotification() {} void OnAudioDataStreamingNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,4 +50,3 @@ void OnAudioDataStreamingNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_button_event_notification.cc b/src/components/application_manager/src/commands/hmi/on_button_event_notification.cc index c82529b0b8..fc8d5989a1 100644 --- a/src/components/application_manager/src/commands/hmi/on_button_event_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_button_event_notification.cc @@ -42,8 +42,8 @@ namespace commands { namespace hmi { OnButtonEventNotification::OnButtonEventNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager) : NotificationFromHMI(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : NotificationFromHMI(message, application_manager) {} void OnButtonEventNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -59,4 +59,3 @@ void OnButtonEventNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_button_press_notification.cc b/src/components/application_manager/src/commands/hmi/on_button_press_notification.cc index 567b243638..abff87c962 100644 --- a/src/components/application_manager/src/commands/hmi/on_button_press_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_button_press_notification.cc @@ -43,8 +43,8 @@ namespace commands { namespace hmi { OnButtonPressNotification::OnButtonPressNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager) : NotificationFromHMI(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : NotificationFromHMI(message, application_manager) {} void OnButtonPressNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -61,4 +61,3 @@ void OnButtonPressNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_button_subscription_notification.cc b/src/components/application_manager/src/commands/hmi/on_button_subscription_notification.cc index a8e8968e20..aae994ea34 100644 --- a/src/components/application_manager/src/commands/hmi/on_button_subscription_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_button_subscription_notification.cc @@ -39,11 +39,10 @@ namespace commands { namespace hmi { OnButtonSubscriptionNotification::OnButtonSubscriptionNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager) : NotificationToHMI(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : NotificationToHMI(message, application_manager) {} -OnButtonSubscriptionNotification::~OnButtonSubscriptionNotification() { -} +OnButtonSubscriptionNotification::~OnButtonSubscriptionNotification() {} void OnButtonSubscriptionNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -56,4 +55,3 @@ void OnButtonSubscriptionNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_device_chosen_notification.cc b/src/components/application_manager/src/commands/hmi/on_device_chosen_notification.cc index d541360148..83ec785a9d 100644 --- a/src/components/application_manager/src/commands/hmi/on_device_chosen_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_device_chosen_notification.cc @@ -32,17 +32,15 @@ #include "application_manager/commands/hmi/on_device_chosen_notification.h" - namespace application_manager { namespace commands { OnDeviceChosenNotification::OnDeviceChosenNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager) : NotificationFromHMI(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : NotificationFromHMI(message, application_manager) {} -OnDeviceChosenNotification::~OnDeviceChosenNotification() { -} +OnDeviceChosenNotification::~OnDeviceChosenNotification() {} void OnDeviceChosenNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/on_device_state_changed_notification.cc b/src/components/application_manager/src/commands/hmi/on_device_state_changed_notification.cc index 5247c0686e..346c05032b 100644 --- a/src/components/application_manager/src/commands/hmi/on_device_state_changed_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_device_state_changed_notification.cc @@ -79,9 +79,8 @@ namespace application_manager { namespace commands { OnDeviceStateChangedNotification::OnDeviceStateChangedNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : NotificationFromHMI(message, application_manager) {} OnDeviceStateChangedNotification::~OnDeviceStateChangedNotification() {} diff --git a/src/components/application_manager/src/commands/hmi/on_driver_distraction_notification.cc b/src/components/application_manager/src/commands/hmi/on_driver_distraction_notification.cc index c5bf69afae..4c322c456f 100644 --- a/src/components/application_manager/src/commands/hmi/on_driver_distraction_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_driver_distraction_notification.cc @@ -45,19 +45,16 @@ namespace hmi { OnDriverDistractionNotification::OnDriverDistractionNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnDriverDistractionNotification::~OnDriverDistractionNotification() { -} +OnDriverDistractionNotification::~OnDriverDistractionNotification() {} void OnDriverDistractionNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); const hmi_apis::Common_DriverDistractionState::eType state = static_cast<hmi_apis::Common_DriverDistractionState::eType>( - (*message_)[strings::msg_params][hmi_notification::state] - .asInt()); + (*message_)[strings::msg_params][hmi_notification::state].asInt()); application_manager_.set_driver_distraction(state); smart_objects::SmartObjectSPtr on_driver_distraction = @@ -81,8 +78,8 @@ void OnDriverDistractionNotification::Run() { for (; applications.end() != it; ++it) { const ApplicationSharedPtr app = *it; if (app) { - (*on_driver_distraction)[strings::params] - [strings::connection_key] = app->app_id(); + (*on_driver_distraction)[strings::params][strings::connection_key] = + app->app_id(); SendNotificationToMobile(on_driver_distraction); } } diff --git a/src/components/application_manager/src/commands/hmi/on_event_changed_notification.cc b/src/components/application_manager/src/commands/hmi/on_event_changed_notification.cc index 02fe73bf4f..c211ffde50 100644 --- a/src/components/application_manager/src/commands/hmi/on_event_changed_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_event_changed_notification.cc @@ -32,22 +32,20 @@ #include "application_manager/commands/hmi/on_event_changed_notification.h" - namespace application_manager { namespace commands { OnEventChangedNotification::OnEventChangedNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnEventChangedNotification::~OnEventChangedNotification() { -} +OnEventChangedNotification::~OnEventChangedNotification() {} void OnEventChangedNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); - event_engine::Event event(hmi_apis::FunctionID::BasicCommunication_OnEventChanged); + event_engine::Event event( + hmi_apis::FunctionID::BasicCommunication_OnEventChanged); event.set_smart_object(*message_); event.raise(application_manager_.event_dispatcher()); } @@ -55,4 +53,3 @@ void OnEventChangedNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_exit_all_applications_notification.cc b/src/components/application_manager/src/commands/hmi/on_exit_all_applications_notification.cc index 62ddbc573e..682093cef9 100644 --- a/src/components/application_manager/src/commands/hmi/on_exit_all_applications_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_exit_all_applications_notification.cc @@ -40,18 +40,15 @@ #include "application_manager/resumption/resume_ctrl.h" #include "interfaces/HMI_API.h" - namespace application_manager { namespace commands { OnExitAllApplicationsNotification::OnExitAllApplicationsNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnExitAllApplicationsNotification::~OnExitAllApplicationsNotification() { -} +OnExitAllApplicationsNotification::~OnExitAllApplicationsNotification() {} void OnExitAllApplicationsNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -81,7 +78,7 @@ void OnExitAllApplicationsNotification::Run() { SendOnSDLPersistenceComplete(); return; } - default : { + default: { LOG4CXX_ERROR(logger_, "Unknown Application close reason" << reason); return; } @@ -90,7 +87,8 @@ void OnExitAllApplicationsNotification::Run() { application_manager_.SetUnregisterAllApplicationsReason(mob_reason); if (mobile_api::AppInterfaceUnregisteredReason::MASTER_RESET == mob_reason || - mobile_api::AppInterfaceUnregisteredReason::FACTORY_DEFAULTS == mob_reason) { + mobile_api::AppInterfaceUnregisteredReason::FACTORY_DEFAULTS == + mob_reason) { application_manager_.HeadUnitReset(mob_reason); } kill(getpid(), SIGINT); @@ -103,14 +101,14 @@ void OnExitAllApplicationsNotification::SendOnSDLPersistenceComplete() { new smart_objects::SmartObject(smart_objects::SmartType_Map); (*message)[strings::params][strings::function_id] = hmi_apis::FunctionID::BasicCommunication_OnSDLPersistenceComplete; - (*message)[strings::params][strings::message_type] = MessageType::kNotification; + (*message)[strings::params][strings::message_type] = + MessageType::kNotification; (*message)[strings::params][strings::correlation_id] = application_manager_.GetNextHMICorrelationID(); - application_manager_.ManageHMICommand(message); + application_manager_.ManageHMICommand(message); } } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_exit_application_notification.cc b/src/components/application_manager/src/commands/hmi/on_exit_application_notification.cc index 4186036b02..a7b6b9a2cd 100644 --- a/src/components/application_manager/src/commands/hmi/on_exit_application_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_exit_application_notification.cc @@ -43,11 +43,10 @@ namespace application_manager { namespace commands { OnExitApplicationNotification::OnExitApplicationNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager) : NotificationFromHMI(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : NotificationFromHMI(message, application_manager) {} -OnExitApplicationNotification::~OnExitApplicationNotification() { -} +OnExitApplicationNotification::~OnExitApplicationNotification() {} void OnExitApplicationNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -64,8 +63,8 @@ void OnExitApplicationNotification::Run() { } Common_ApplicationExitReason::eType reason; - reason = static_cast<Common_ApplicationExitReason::eType> - ((*message_)[strings::msg_params][strings::reason].asInt()); + reason = static_cast<Common_ApplicationExitReason::eType>( + (*message_)[strings::msg_params][strings::reason].asInt()); switch (reason) { case Common_ApplicationExitReason::DRIVER_DISTRACTION_VIOLATION: { @@ -80,15 +79,19 @@ void OnExitApplicationNotification::Run() { break; } case Common_ApplicationExitReason::UNAUTHORIZED_TRANSPORT_REGISTRATION: { - application_manager_.ManageMobileCommand(MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( - app_id, AppInterfaceUnregisteredReason::APP_UNAUTHORIZED), commands::Command::ORIGIN_SDL); + application_manager_.ManageMobileCommand( + MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( + app_id, AppInterfaceUnregisteredReason::APP_UNAUTHORIZED), + commands::Command::ORIGIN_SDL); // HMI rejects registration for navi application application_manager_.UnregisterApplication(app_id, Result::SUCCESS); return; } case Common_ApplicationExitReason::UNSUPPORTED_HMI_RESOURCE: { - application_manager_.ManageMobileCommand(MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( - app_id, AppInterfaceUnregisteredReason::UNSUPPORTED_HMI_RESOURCE), commands::Command::ORIGIN_SDL); + application_manager_.ManageMobileCommand( + MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( + app_id, AppInterfaceUnregisteredReason::UNSUPPORTED_HMI_RESOURCE), + commands::Command::ORIGIN_SDL); application_manager_.UnregisterApplication(app_id, Result::SUCCESS); return; } diff --git a/src/components/application_manager/src/commands/hmi/on_file_removed_notification.cc b/src/components/application_manager/src/commands/hmi/on_file_removed_notification.cc index 9977da6df1..e69d111d2c 100644 --- a/src/components/application_manager/src/commands/hmi/on_file_removed_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_file_removed_notification.cc @@ -32,17 +32,15 @@ #include "application_manager/commands/hmi/on_file_removed_notification.h" - namespace application_manager { namespace commands { OnFileRemovedNotification::OnFileRemovedNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager) : NotificationToHMI(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : NotificationToHMI(message, application_manager) {} -OnFileRemovedNotification::~OnFileRemovedNotification() { -} +OnFileRemovedNotification::~OnFileRemovedNotification() {} void OnFileRemovedNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -53,4 +51,3 @@ void OnFileRemovedNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_find_applications.cc b/src/components/application_manager/src/commands/hmi/on_find_applications.cc index e572e7bd2f..9d3633ba6d 100644 --- a/src/components/application_manager/src/commands/hmi/on_find_applications.cc +++ b/src/components/application_manager/src/commands/hmi/on_find_applications.cc @@ -36,12 +36,11 @@ namespace application_manager { namespace commands { -OnFindApplications::OnFindApplications(const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} +OnFindApplications::OnFindApplications(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : NotificationFromHMI(message, application_manager) {} -OnFindApplications::~OnFindApplications() { -} +OnFindApplications::~OnFindApplications() {} void OnFindApplications::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,4 +51,3 @@ void OnFindApplications::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_ignition_cycle_over_notification.cc b/src/components/application_manager/src/commands/hmi/on_ignition_cycle_over_notification.cc index 126869a2ec..8c772d6dcd 100644 --- a/src/components/application_manager/src/commands/hmi/on_ignition_cycle_over_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_ignition_cycle_over_notification.cc @@ -39,11 +39,9 @@ namespace commands { OnIgnitionCycleOverNotification::OnIgnitionCycleOverNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnIgnitionCycleOverNotification::~OnIgnitionCycleOverNotification() { -} +OnIgnitionCycleOverNotification::~OnIgnitionCycleOverNotification() {} void OnIgnitionCycleOverNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -53,4 +51,3 @@ void OnIgnitionCycleOverNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_navi_tbt_client_state_notification.cc b/src/components/application_manager/src/commands/hmi/on_navi_tbt_client_state_notification.cc index 36c63002b6..e25de1f3a9 100644 --- a/src/components/application_manager/src/commands/hmi/on_navi_tbt_client_state_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_navi_tbt_client_state_notification.cc @@ -39,11 +39,9 @@ namespace commands { OnNaviTBTClientStateNotification::OnNaviTBTClientStateNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnNaviTBTClientStateNotification::~OnNaviTBTClientStateNotification() { -} +OnNaviTBTClientStateNotification::~OnNaviTBTClientStateNotification() {} void OnNaviTBTClientStateNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -58,4 +56,3 @@ void OnNaviTBTClientStateNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_navi_way_point_change_notification.cc b/src/components/application_manager/src/commands/hmi/on_navi_way_point_change_notification.cc index 2a28775c5b..17d1b420be 100644 --- a/src/components/application_manager/src/commands/hmi/on_navi_way_point_change_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_navi_way_point_change_notification.cc @@ -38,11 +38,9 @@ namespace commands { OnNaviWayPointChangeNotification::OnNaviWayPointChangeNotification( const MessageSharedPtr& message, ApplicationManager& app_man) - : NotificationFromHMI(message, app_man) { -} + : NotificationFromHMI(message, app_man) {} -OnNaviWayPointChangeNotification::~OnNaviWayPointChangeNotification() { -} +OnNaviWayPointChangeNotification::~OnNaviWayPointChangeNotification() {} void OnNaviWayPointChangeNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/on_policy_update.cc b/src/components/application_manager/src/commands/hmi/on_policy_update.cc index 34010cbd61..39b179f967 100644 --- a/src/components/application_manager/src/commands/hmi/on_policy_update.cc +++ b/src/components/application_manager/src/commands/hmi/on_policy_update.cc @@ -36,12 +36,11 @@ namespace application_manager { namespace commands { -OnPolicyUpdate::OnPolicyUpdate(const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} +OnPolicyUpdate::OnPolicyUpdate(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : NotificationFromHMI(message, application_manager) {} -OnPolicyUpdate::~OnPolicyUpdate() { -} +OnPolicyUpdate::~OnPolicyUpdate() {} void OnPolicyUpdate::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/on_put_file_notification.cc b/src/components/application_manager/src/commands/hmi/on_put_file_notification.cc index 24970510c7..596b7d4549 100644 --- a/src/components/application_manager/src/commands/hmi/on_put_file_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_put_file_notification.cc @@ -39,11 +39,9 @@ namespace commands { OnPutFileNotification::OnPutFileNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationToHMI(message, application_manager) { -} + : NotificationToHMI(message, application_manager) {} -OnPutFileNotification::~OnPutFileNotification() { -} +OnPutFileNotification::~OnPutFileNotification() {} void OnPutFileNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -53,4 +51,3 @@ void OnPutFileNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_ready_notification.cc b/src/components/application_manager/src/commands/hmi/on_ready_notification.cc index 0f3798a065..3a45e0f934 100644 --- a/src/components/application_manager/src/commands/hmi/on_ready_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_ready_notification.cc @@ -32,17 +32,15 @@ #include "application_manager/commands/hmi/on_ready_notification.h" - namespace application_manager { namespace commands { -OnReadyNotification::OnReadyNotification(const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} +OnReadyNotification::OnReadyNotification( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : NotificationFromHMI(message, application_manager) {} -OnReadyNotification::~OnReadyNotification() { -} +OnReadyNotification::~OnReadyNotification() {} void OnReadyNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -56,4 +54,3 @@ void OnReadyNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_received_policy_update.cc b/src/components/application_manager/src/commands/hmi/on_received_policy_update.cc index a40843c3bf..ee7da70ede 100644 --- a/src/components/application_manager/src/commands/hmi/on_received_policy_update.cc +++ b/src/components/application_manager/src/commands/hmi/on_received_policy_update.cc @@ -39,12 +39,11 @@ namespace application_manager { namespace commands { -OnReceivedPolicyUpdate::OnReceivedPolicyUpdate(const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} +OnReceivedPolicyUpdate::OnReceivedPolicyUpdate( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : NotificationFromHMI(message, application_manager) {} -OnReceivedPolicyUpdate::~OnReceivedPolicyUpdate() { -} +OnReceivedPolicyUpdate::~OnReceivedPolicyUpdate() {} void OnReceivedPolicyUpdate::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -55,7 +54,8 @@ void OnReceivedPolicyUpdate::Run() { LOG4CXX_ERROR(logger_, "Failed to read Update file."); return; } - application_manager_.GetPolicyHandler().ReceiveMessageFromSDK(file_path, file_content); + application_manager_.GetPolicyHandler().ReceiveMessageFromSDK(file_path, + file_content); } } // namespace commands diff --git a/src/components/application_manager/src/commands/hmi/on_record_start_notification.cc b/src/components/application_manager/src/commands/hmi/on_record_start_notification.cc index 45cb9f543b..4d126ac67d 100644 --- a/src/components/application_manager/src/commands/hmi/on_record_start_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_record_start_notification.cc @@ -32,17 +32,15 @@ #include "application_manager/commands/hmi/on_record_start_notification.h" - namespace application_manager { namespace commands { OnRecordStartdNotification::OnRecordStartdNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager) : NotificationToHMI(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : NotificationToHMI(message, application_manager) {} -OnRecordStartdNotification::~OnRecordStartdNotification() { -} +OnRecordStartdNotification::~OnRecordStartdNotification() {} void OnRecordStartdNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -53,4 +51,3 @@ void OnRecordStartdNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_resume_audio_source_notification.cc b/src/components/application_manager/src/commands/hmi/on_resume_audio_source_notification.cc index 2e88575866..ce3c371cf8 100644 --- a/src/components/application_manager/src/commands/hmi/on_resume_audio_source_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_resume_audio_source_notification.cc @@ -39,11 +39,9 @@ namespace commands { OnResumeAudioSourceNotification::OnResumeAudioSourceNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationToHMI(message, application_manager) { -} + : NotificationToHMI(message, application_manager) {} -OnResumeAudioSourceNotification::~OnResumeAudioSourceNotification() { -} +OnResumeAudioSourceNotification::~OnResumeAudioSourceNotification() {} void OnResumeAudioSourceNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -53,4 +51,3 @@ void OnResumeAudioSourceNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_sdl_close_notification.cc b/src/components/application_manager/src/commands/hmi/on_sdl_close_notification.cc index 35baa40707..0517ea8d24 100644 --- a/src/components/application_manager/src/commands/hmi/on_sdl_close_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_sdl_close_notification.cc @@ -37,11 +37,10 @@ namespace application_manager { namespace commands { OnSDLCloseNotification::OnSDLCloseNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager) : NotificationToHMI(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : NotificationToHMI(message, application_manager) {} -OnSDLCloseNotification::~OnSDLCloseNotification() { -} +OnSDLCloseNotification::~OnSDLCloseNotification() {} void OnSDLCloseNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,4 +51,3 @@ void OnSDLCloseNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_sdl_consent_needed_notification.cc b/src/components/application_manager/src/commands/hmi/on_sdl_consent_needed_notification.cc index b7e363798d..a9c36813f6 100644 --- a/src/components/application_manager/src/commands/hmi/on_sdl_consent_needed_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_sdl_consent_needed_notification.cc @@ -39,11 +39,9 @@ namespace commands { OnSDLConsentNeededNotification::OnSDLConsentNeededNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationToHMI(message, application_manager) { -} + : NotificationToHMI(message, application_manager) {} -OnSDLConsentNeededNotification::~OnSDLConsentNeededNotification() { -} +OnSDLConsentNeededNotification::~OnSDLConsentNeededNotification() {} void OnSDLConsentNeededNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -53,4 +51,3 @@ void OnSDLConsentNeededNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_sdl_persistence_complete_notification.cc b/src/components/application_manager/src/commands/hmi/on_sdl_persistence_complete_notification.cc index 6fa7250be2..e30a0fb902 100644 --- a/src/components/application_manager/src/commands/hmi/on_sdl_persistence_complete_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_sdl_persistence_complete_notification.cc @@ -38,11 +38,9 @@ namespace commands { OnSDLPersistenceCompleteNotification::OnSDLPersistenceCompleteNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationToHMI(message, application_manager) { -} + : NotificationToHMI(message, application_manager) {} -OnSDLPersistenceCompleteNotification::~OnSDLPersistenceCompleteNotification() { -} +OnSDLPersistenceCompleteNotification::~OnSDLPersistenceCompleteNotification() {} void OnSDLPersistenceCompleteNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/on_start_device_discovery.cc b/src/components/application_manager/src/commands/hmi/on_start_device_discovery.cc index 7697b5b8c7..8e94b2b004 100644 --- a/src/components/application_manager/src/commands/hmi/on_start_device_discovery.cc +++ b/src/components/application_manager/src/commands/hmi/on_start_device_discovery.cc @@ -32,17 +32,15 @@ #include "application_manager/commands/hmi/on_start_device_discovery.h" - namespace application_manager { namespace commands { -OnStartDeviceDiscovery::OnStartDeviceDiscovery(const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} +OnStartDeviceDiscovery::OnStartDeviceDiscovery( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : NotificationFromHMI(message, application_manager) {} -OnStartDeviceDiscovery::~OnStartDeviceDiscovery() { -} +OnStartDeviceDiscovery::~OnStartDeviceDiscovery() {} void OnStartDeviceDiscovery::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -53,4 +51,3 @@ void OnStartDeviceDiscovery::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_status_update_notification.cc b/src/components/application_manager/src/commands/hmi/on_status_update_notification.cc index 385140d67e..78a6b68324 100644 --- a/src/components/application_manager/src/commands/hmi/on_status_update_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_status_update_notification.cc @@ -38,11 +38,9 @@ namespace commands { OnStatusUpdateNotification::OnStatusUpdateNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationToHMI(message, application_manager) { -} + : NotificationToHMI(message, application_manager) {} -OnStatusUpdateNotification::~OnStatusUpdateNotification() { -} +OnStatusUpdateNotification::~OnStatusUpdateNotification() {} void OnStatusUpdateNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,4 +50,3 @@ void OnStatusUpdateNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_system_context_notification.cc b/src/components/application_manager/src/commands/hmi/on_system_context_notification.cc index 6d9ab5b10e..887aacf5b9 100644 --- a/src/components/application_manager/src/commands/hmi/on_system_context_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_system_context_notification.cc @@ -41,18 +41,17 @@ namespace commands { OnSystemContextNotification::OnSystemContextNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnSystemContextNotification::~OnSystemContextNotification() { -} +OnSystemContextNotification::~OnSystemContextNotification() {} void OnSystemContextNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); mobile_api::SystemContext::eType system_context = - static_cast<mobile_api::SystemContext::eType>( - (*message_)[strings::msg_params][hmi_notification::system_context].asInt()); + static_cast<mobile_api::SystemContext::eType>( + (*message_)[strings::msg_params][hmi_notification::system_context] + .asInt()); ApplicationSharedPtr app; if ((mobile_api::SystemContext::SYSCTXT_VRSESSION == system_context) || @@ -62,13 +61,14 @@ void OnSystemContextNotification::Run() { } else if ((mobile_api::SystemContext::SYSCTXT_ALERT == system_context) || (mobile_api::SystemContext::SYSCTXT_MAIN == system_context)) { if ((*message_)[strings::msg_params].keyExists(strings::app_id)) { - app = application_manager_. - application((*message_)[strings::msg_params][strings::app_id].asUInt()); + app = application_manager_.application( + (*message_)[strings::msg_params][strings::app_id].asUInt()); } } if (app && mobile_api::SystemContext::INVALID_ENUM != system_context) { - application_manager_.state_controller().SetRegularState(app, system_context); + application_manager_.state_controller().SetRegularState(app, + system_context); } else { LOG4CXX_ERROR(logger_, "Application does not exist"); } diff --git a/src/components/application_manager/src/commands/hmi/on_system_error_notification.cc b/src/components/application_manager/src/commands/hmi/on_system_error_notification.cc index 3730dc2c64..4885420f1c 100644 --- a/src/components/application_manager/src/commands/hmi/on_system_error_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_system_error_notification.cc @@ -40,17 +40,15 @@ namespace commands { OnSystemErrorNotification::OnSystemErrorNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnSystemErrorNotification::~OnSystemErrorNotification() { -} +OnSystemErrorNotification::~OnSystemErrorNotification() {} void OnSystemErrorNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); - const int code = (*message_)[strings::msg_params][hmi_notification::error] - .asInt(); + const int code = + (*message_)[strings::msg_params][hmi_notification::error].asInt(); application_manager_.GetPolicyHandler().OnSystemError(code); } @@ -58,4 +56,3 @@ void OnSystemErrorNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_system_info_changed_notification.cc b/src/components/application_manager/src/commands/hmi/on_system_info_changed_notification.cc index 9c852caa36..00b3649284 100644 --- a/src/components/application_manager/src/commands/hmi/on_system_info_changed_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_system_info_changed_notification.cc @@ -40,11 +40,9 @@ namespace commands { OnSystemInfoChangedNotification::OnSystemInfoChangedNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnSystemInfoChangedNotification::~OnSystemInfoChangedNotification() { -} +OnSystemInfoChangedNotification::~OnSystemInfoChangedNotification() {} void OnSystemInfoChangedNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,7 +50,7 @@ void OnSystemInfoChangedNotification::Run() { (*message_)[strings::msg_params][strings::language].asUInt(); const std::string language = application_manager::MessageHelper::CommonLanguageToString( - static_cast<hmi_apis::Common_Language::eType>(lang_code)); + static_cast<hmi_apis::Common_Language::eType>(lang_code)); application_manager_.GetPolicyHandler().OnSystemInfoChanged(language); } @@ -60,5 +58,3 @@ void OnSystemInfoChangedNotification::Run() { } // namespace commands } // namespace application_manager - - diff --git a/src/components/application_manager/src/commands/hmi/on_system_request_notification.cc b/src/components/application_manager/src/commands/hmi/on_system_request_notification.cc index fd0b4256a1..ce83d28db4 100644 --- a/src/components/application_manager/src/commands/hmi/on_system_request_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_system_request_notification.cc @@ -44,12 +44,10 @@ namespace application_manager { namespace commands { OnSystemRequestNotification::OnSystemRequestNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : NotificationFromHMI(message, application_manager) {} -OnSystemRequestNotification::~OnSystemRequestNotification() { -} +OnSystemRequestNotification::~OnSystemRequestNotification() {} void OnSystemRequestNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -58,27 +56,29 @@ void OnSystemRequestNotification::Run() { smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params]; params[strings::function_id] = - static_cast<int32_t>(mobile_apis::FunctionID::eType::OnSystemRequestID); + static_cast<int32_t>(mobile_apis::FunctionID::eType::OnSystemRequestID); const std::string app_id = msg_params[strings::app_id].asString(); - LOG4CXX_DEBUG(logger_, "Received OnSystemRequest for " << app_id ); + LOG4CXX_DEBUG(logger_, "Received OnSystemRequest for " << app_id); ApplicationSharedPtr app; if (strings::default_app_id == app_id) { - const policy::PolicyHandlerInterface& policy_handler = - application_manager_.GetPolicyHandler(); + const policy::PolicyHandlerInterface& policy_handler = + application_manager_.GetPolicyHandler(); const uint32_t selected_app_id = policy_handler.GetAppIdForSending(); if (0 == selected_app_id) { - LOG4CXX_WARN(logger_, - "Can't select application to forward OnSystemRequestNotification"); + LOG4CXX_WARN( + logger_, + "Can't select application to forward OnSystemRequestNotification"); return; } app = application_manager_.application(selected_app_id); } if (!app.valid()) { - LOG4CXX_WARN(logger_, "Application with connection key " << app_id << - "is not registered."); + LOG4CXX_WARN(logger_, + "Application with connection key " << app_id + << "is not registered."); return; } @@ -89,4 +89,3 @@ void OnSystemRequestNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_tts_language_change_notification.cc b/src/components/application_manager/src/commands/hmi/on_tts_language_change_notification.cc index d0ef234850..bd152c2af0 100644 --- a/src/components/application_manager/src/commands/hmi/on_tts_language_change_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_tts_language_change_notification.cc @@ -42,17 +42,14 @@ namespace commands { OnTTSLanguageChangeNotification::OnTTSLanguageChangeNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnTTSLanguageChangeNotification::~OnTTSLanguageChangeNotification() { -} +OnTTSLanguageChangeNotification::~OnTTSLanguageChangeNotification() {} void OnTTSLanguageChangeNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); - HMICapabilities& hmi_capabilities = - application_manager_.hmi_capabilities(); + HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities(); hmi_capabilities.set_active_tts_language( static_cast<hmi_apis::Common_Language::eType>( @@ -70,18 +67,21 @@ void OnTTSLanguageChangeNotification::Run() { (*message_)[strings::params][strings::function_id] = static_cast<int32_t>(mobile_apis::FunctionID::OnLanguageChangeID); - const ApplicationSet& accessor = application_manager_.applications().GetData(); + const ApplicationSet& accessor = + application_manager_.applications().GetData(); ApplicationSetIt it = accessor.begin(); for (; accessor.end() != it;) { ApplicationSharedPtr app = *it++; (*message_)[strings::params][strings::connection_key] = app->app_id(); SendNotificationToMobile(message_); - if (static_cast<int>(app->language()) - != (*message_)[strings::msg_params][strings::language].asInt()) { - application_manager_.ManageMobileCommand(MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( - app->app_id(), - mobile_api::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE), commands::Command::ORIGIN_SDL); + if (static_cast<int>(app->language()) != + (*message_)[strings::msg_params][strings::language].asInt()) { + application_manager_.ManageMobileCommand( + MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( + app->app_id(), + mobile_api::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE), + commands::Command::ORIGIN_SDL); application_manager_.UnregisterApplication( app->app_id(), mobile_apis::Result::SUCCESS, false); } diff --git a/src/components/application_manager/src/commands/hmi/on_tts_reset_timeout_notification.cc b/src/components/application_manager/src/commands/hmi/on_tts_reset_timeout_notification.cc index 51af2ae0d2..283e2056ba 100644 --- a/src/components/application_manager/src/commands/hmi/on_tts_reset_timeout_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_tts_reset_timeout_notification.cc @@ -9,11 +9,10 @@ namespace commands { namespace hmi { OnTTSResetTimeoutNotification::OnTTSResetTimeoutNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager) : NotificationFromHMI(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : NotificationFromHMI(message, application_manager) {} -OnTTSResetTimeoutNotification::~OnTTSResetTimeoutNotification() { -} +OnTTSResetTimeoutNotification::~OnTTSResetTimeoutNotification() {} void OnTTSResetTimeoutNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -28,4 +27,3 @@ void OnTTSResetTimeoutNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_tts_started_notification.cc b/src/components/application_manager/src/commands/hmi/on_tts_started_notification.cc index 9f9387c27c..317465f354 100644 --- a/src/components/application_manager/src/commands/hmi/on_tts_started_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_tts_started_notification.cc @@ -32,18 +32,15 @@ #include "application_manager/commands/hmi/on_tts_started_notification.h" - namespace application_manager { namespace commands { OnTTSStartedNotification::OnTTSStartedNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnTTSStartedNotification::~OnTTSStartedNotification() { -} +OnTTSStartedNotification::~OnTTSStartedNotification() {} void OnTTSStartedNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -55,4 +52,3 @@ void OnTTSStartedNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_tts_stopped_notification.cc b/src/components/application_manager/src/commands/hmi/on_tts_stopped_notification.cc index 2d953651ee..7f763d8598 100644 --- a/src/components/application_manager/src/commands/hmi/on_tts_stopped_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_tts_stopped_notification.cc @@ -40,11 +40,9 @@ namespace commands { OnTTSStoppedNotification::OnTTSStoppedNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnTTSStoppedNotification::~OnTTSStoppedNotification() { -} +OnTTSStoppedNotification::~OnTTSStoppedNotification() {} void OnTTSStoppedNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -57,4 +55,3 @@ void OnTTSStoppedNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_ui_command_notification.cc b/src/components/application_manager/src/commands/hmi/on_ui_command_notification.cc index c6563744d3..9f91d99a85 100644 --- a/src/components/application_manager/src/commands/hmi/on_ui_command_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_ui_command_notification.cc @@ -39,11 +39,9 @@ namespace commands { OnUICommandNotification::OnUICommandNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnUICommandNotification::~OnUICommandNotification() { -} +OnUICommandNotification::~OnUICommandNotification() {} void OnUICommandNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -59,4 +57,3 @@ void OnUICommandNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_ui_keyboard_input_notification.cc b/src/components/application_manager/src/commands/hmi/on_ui_keyboard_input_notification.cc index 920a2364da..117fec5741 100644 --- a/src/components/application_manager/src/commands/hmi/on_ui_keyboard_input_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_ui_keyboard_input_notification.cc @@ -40,18 +40,17 @@ namespace commands { namespace hmi { OnUIKeyBoardInputNotification::OnUIKeyBoardInputNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager) : NotificationFromHMI(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : NotificationFromHMI(message, application_manager) {} -OnUIKeyBoardInputNotification::~OnUIKeyBoardInputNotification() { -} +OnUIKeyBoardInputNotification::~OnUIKeyBoardInputNotification() {} void OnUIKeyBoardInputNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); - //prepare SmartObject for mobile factory + // prepare SmartObject for mobile factory (*message_)[strings::params][strings::function_id] = - mobile_apis::FunctionID::OnKeyboardInputID; + mobile_apis::FunctionID::OnKeyboardInputID; SendNotificationToMobile(message_); } @@ -60,4 +59,3 @@ void OnUIKeyBoardInputNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_ui_language_change_notification.cc b/src/components/application_manager/src/commands/hmi/on_ui_language_change_notification.cc index ea6b9a9722..6e8e38f757 100644 --- a/src/components/application_manager/src/commands/hmi/on_ui_language_change_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_ui_language_change_notification.cc @@ -42,17 +42,14 @@ namespace commands { OnUILanguageChangeNotification::OnUILanguageChangeNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnUILanguageChangeNotification::~OnUILanguageChangeNotification() { -} +OnUILanguageChangeNotification::~OnUILanguageChangeNotification() {} void OnUILanguageChangeNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); - HMICapabilities& hmi_capabilities = - application_manager_.hmi_capabilities(); + HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities(); hmi_capabilities.set_active_ui_language( static_cast<hmi_apis::Common_Language::eType>( @@ -76,12 +73,14 @@ void OnUILanguageChangeNotification::Run() { (*message_)[strings::params][strings::connection_key] = app->app_id(); SendNotificationToMobile(message_); - if (app->ui_language() != (*message_)[strings::msg_params] - [strings::hmi_display_language].asInt()) { - - application_manager_.ManageMobileCommand(MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( - app->app_id(), - mobile_api::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE), commands::Command::ORIGIN_SDL); + if (app->ui_language() != + (*message_)[strings::msg_params][strings::hmi_display_language] + .asInt()) { + application_manager_.ManageMobileCommand( + MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( + app->app_id(), + mobile_api::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE), + commands::Command::ORIGIN_SDL); application_manager_.UnregisterApplication( app->app_id(), mobile_apis::Result::SUCCESS, false); } @@ -91,4 +90,3 @@ void OnUILanguageChangeNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_ui_reset_timeout_notification.cc b/src/components/application_manager/src/commands/hmi/on_ui_reset_timeout_notification.cc index b1be0cd14b..a5fea7bf8d 100644 --- a/src/components/application_manager/src/commands/hmi/on_ui_reset_timeout_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_ui_reset_timeout_notification.cc @@ -41,11 +41,10 @@ namespace commands { namespace hmi { OnUIResetTimeoutNotification::OnUIResetTimeoutNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager) : NotificationFromHMI(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : NotificationFromHMI(message, application_manager) {} -OnUIResetTimeoutNotification::~OnUIResetTimeoutNotification() { -} +OnUIResetTimeoutNotification::~OnUIResetTimeoutNotification() {} void OnUIResetTimeoutNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -60,4 +59,3 @@ void OnUIResetTimeoutNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_ui_touch_event_notification.cc b/src/components/application_manager/src/commands/hmi/on_ui_touch_event_notification.cc index 3c4b9aa50b..7709af8720 100644 --- a/src/components/application_manager/src/commands/hmi/on_ui_touch_event_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_ui_touch_event_notification.cc @@ -40,18 +40,17 @@ namespace commands { namespace hmi { OnUITouchEventNotification::OnUITouchEventNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager) : NotificationFromHMI(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : NotificationFromHMI(message, application_manager) {} -OnUITouchEventNotification::~OnUITouchEventNotification() { -} +OnUITouchEventNotification::~OnUITouchEventNotification() {} void OnUITouchEventNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); - //prepare SmartObject for mobile factory + // prepare SmartObject for mobile factory (*message_)[strings::params][strings::function_id] = - mobile_apis::FunctionID::OnTouchEventID; + mobile_apis::FunctionID::OnTouchEventID; SendNotificationToMobile(message_); } @@ -60,4 +59,3 @@ void OnUITouchEventNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_update_device_list.cc b/src/components/application_manager/src/commands/hmi/on_update_device_list.cc index 00822582e0..b245ea21aa 100644 --- a/src/components/application_manager/src/commands/hmi/on_update_device_list.cc +++ b/src/components/application_manager/src/commands/hmi/on_update_device_list.cc @@ -31,17 +31,15 @@ */ #include "application_manager/commands/hmi/on_update_device_list.h" - namespace application_manager { namespace commands { -OnUpdateDeviceList::OnUpdateDeviceList(const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} +OnUpdateDeviceList::OnUpdateDeviceList(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : NotificationFromHMI(message, application_manager) {} -OnUpdateDeviceList::~OnUpdateDeviceList() { -} +OnUpdateDeviceList::~OnUpdateDeviceList() {} void OnUpdateDeviceList::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -50,4 +48,3 @@ void OnUpdateDeviceList::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_vi_acc_pedal_position_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_acc_pedal_position_notification.cc index a0a71955b0..9b10055e2c 100644 --- a/src/components/application_manager/src/commands/hmi/on_vi_acc_pedal_position_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_vi_acc_pedal_position_notification.cc @@ -39,11 +39,9 @@ namespace commands { OnVIAccPedalPositionNotification::OnVIAccPedalPositionNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnVIAccPedalPositionNotification::~OnVIAccPedalPositionNotification() { -} +OnVIAccPedalPositionNotification::~OnVIAccPedalPositionNotification() {} void OnVIAccPedalPositionNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -58,4 +56,3 @@ void OnVIAccPedalPositionNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_vi_belt_status_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_belt_status_notification.cc index 75863903bb..58f9add514 100644 --- a/src/components/application_manager/src/commands/hmi/on_vi_belt_status_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_vi_belt_status_notification.cc @@ -39,11 +39,9 @@ namespace commands { OnVIBeltStatusNotification::OnVIBeltStatusNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnVIBeltStatusNotification::~OnVIBeltStatusNotification() { -} +OnVIBeltStatusNotification::~OnVIBeltStatusNotification() {} void OnVIBeltStatusNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -58,4 +56,3 @@ void OnVIBeltStatusNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_vi_body_information_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_body_information_notification.cc index 2cab27f29c..33f2944c38 100644 --- a/src/components/application_manager/src/commands/hmi/on_vi_body_information_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_vi_body_information_notification.cc @@ -39,11 +39,9 @@ namespace commands { OnVIBodyInformationNotification::OnVIBodyInformationNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnVIBodyInformationNotification::~OnVIBodyInformationNotification() { -} +OnVIBodyInformationNotification::~OnVIBodyInformationNotification() {} void OnVIBodyInformationNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -58,4 +56,3 @@ void OnVIBodyInformationNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_vi_device_status_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_device_status_notification.cc index bb8f40e318..9cbf612be1 100644 --- a/src/components/application_manager/src/commands/hmi/on_vi_device_status_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_vi_device_status_notification.cc @@ -39,11 +39,9 @@ namespace commands { OnVIDeviceStatusNotification::OnVIDeviceStatusNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnVIDeviceStatusNotification::~OnVIDeviceStatusNotification() { -} +OnVIDeviceStatusNotification::~OnVIDeviceStatusNotification() {} void OnVIDeviceStatusNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -58,4 +56,3 @@ void OnVIDeviceStatusNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_vi_driver_braking_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_driver_braking_notification.cc index 7ef3a05211..e521ac3a37 100644 --- a/src/components/application_manager/src/commands/hmi/on_vi_driver_braking_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_vi_driver_braking_notification.cc @@ -39,11 +39,9 @@ namespace commands { OnVIDriverBrakingNotification::OnVIDriverBrakingNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnVIDriverBrakingNotification::~OnVIDriverBrakingNotification() { -} +OnVIDriverBrakingNotification::~OnVIDriverBrakingNotification() {} void OnVIDriverBrakingNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -58,4 +56,3 @@ void OnVIDriverBrakingNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_vi_engine_torque_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_engine_torque_notification.cc index 390b0eda0a..ebed955270 100644 --- a/src/components/application_manager/src/commands/hmi/on_vi_engine_torque_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_vi_engine_torque_notification.cc @@ -39,11 +39,9 @@ namespace commands { OnVIEngineTorqueNotification::OnVIEngineTorqueNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnVIEngineTorqueNotification::~OnVIEngineTorqueNotification() { -} +OnVIEngineTorqueNotification::~OnVIEngineTorqueNotification() {} void OnVIEngineTorqueNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -58,4 +56,3 @@ void OnVIEngineTorqueNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_vi_external_temperature_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_external_temperature_notification.cc index c77a54e74e..9f0696fdc6 100644 --- a/src/components/application_manager/src/commands/hmi/on_vi_external_temperature_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_vi_external_temperature_notification.cc @@ -39,11 +39,9 @@ namespace commands { OnVIExternalTemperatureNotification::OnVIExternalTemperatureNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnVIExternalTemperatureNotification::~OnVIExternalTemperatureNotification() { -} +OnVIExternalTemperatureNotification::~OnVIExternalTemperatureNotification() {} void OnVIExternalTemperatureNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -58,4 +56,3 @@ void OnVIExternalTemperatureNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_vi_fuel_level_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_fuel_level_notification.cc index e1aaf6c2f2..ef650a9f99 100644 --- a/src/components/application_manager/src/commands/hmi/on_vi_fuel_level_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_vi_fuel_level_notification.cc @@ -39,11 +39,9 @@ namespace commands { OnVIFuelLevelNotification::OnVIFuelLevelNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnVIFuelLevelNotification::~OnVIFuelLevelNotification() { -} +OnVIFuelLevelNotification::~OnVIFuelLevelNotification() {} void OnVIFuelLevelNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -58,4 +56,3 @@ void OnVIFuelLevelNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_vi_fuel_level_state_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_fuel_level_state_notification.cc index 174b3dd5cb..a5267d8dac 100644 --- a/src/components/application_manager/src/commands/hmi/on_vi_fuel_level_state_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_vi_fuel_level_state_notification.cc @@ -39,11 +39,9 @@ namespace commands { OnVIFuelLevelStateNotification::OnVIFuelLevelStateNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnVIFuelLevelStateNotification::~OnVIFuelLevelStateNotification() { -} +OnVIFuelLevelStateNotification::~OnVIFuelLevelStateNotification() {} void OnVIFuelLevelStateNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -58,4 +56,3 @@ void OnVIFuelLevelStateNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_vi_gps_data_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_gps_data_notification.cc index ceff04e5d7..63b95bf6dc 100644 --- a/src/components/application_manager/src/commands/hmi/on_vi_gps_data_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_vi_gps_data_notification.cc @@ -39,11 +39,9 @@ namespace commands { OnVIGpsDataNotification::OnVIGpsDataNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnVIGpsDataNotification::~OnVIGpsDataNotification() { -} +OnVIGpsDataNotification::~OnVIGpsDataNotification() {} void OnVIGpsDataNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -58,4 +56,3 @@ void OnVIGpsDataNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_vi_head_lamp_status_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_head_lamp_status_notification.cc index c7304bfc21..7d494f02d3 100644 --- a/src/components/application_manager/src/commands/hmi/on_vi_head_lamp_status_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_vi_head_lamp_status_notification.cc @@ -39,11 +39,9 @@ namespace commands { OnVIHeadLampStatusNotification::OnVIHeadLampStatusNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnVIHeadLampStatusNotification::~OnVIHeadLampStatusNotification() { -} +OnVIHeadLampStatusNotification::~OnVIHeadLampStatusNotification() {} void OnVIHeadLampStatusNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -58,4 +56,3 @@ void OnVIHeadLampStatusNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc index 3177aca5d2..a62f4cacea 100644 --- a/src/components/application_manager/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_vi_instant_fuel_consumption_notification.cc @@ -39,11 +39,10 @@ namespace commands { OnVIInstantFuelConsumptionNotification::OnVIInstantFuelConsumptionNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnVIInstantFuelConsumptionNotification::~OnVIInstantFuelConsumptionNotification() { -} +OnVIInstantFuelConsumptionNotification:: + ~OnVIInstantFuelConsumptionNotification() {} void OnVIInstantFuelConsumptionNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -58,4 +57,3 @@ void OnVIInstantFuelConsumptionNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_vi_my_key_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_my_key_notification.cc index 1501bbd72d..229d50667b 100644 --- a/src/components/application_manager/src/commands/hmi/on_vi_my_key_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_vi_my_key_notification.cc @@ -39,11 +39,9 @@ namespace commands { OnVIMyKeyNotification::OnVIMyKeyNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnVIMyKeyNotification::~OnVIMyKeyNotification() { -} +OnVIMyKeyNotification::~OnVIMyKeyNotification() {} void OnVIMyKeyNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -58,4 +56,3 @@ void OnVIMyKeyNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_vi_odometer_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_odometer_notification.cc index 5fd9da0f67..10f236539c 100644 --- a/src/components/application_manager/src/commands/hmi/on_vi_odometer_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_vi_odometer_notification.cc @@ -39,11 +39,9 @@ namespace commands { OnVIOdometerNotification::OnVIOdometerNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnVIOdometerNotification::~OnVIOdometerNotification() { -} +OnVIOdometerNotification::~OnVIOdometerNotification() {} void OnVIOdometerNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -58,4 +56,3 @@ void OnVIOdometerNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_vi_prndl_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_prndl_notification.cc index f58f494fcc..81585eabca 100644 --- a/src/components/application_manager/src/commands/hmi/on_vi_prndl_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_vi_prndl_notification.cc @@ -39,11 +39,9 @@ namespace commands { OnVIPrndlNotification::OnVIPrndlNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnVIPrndlNotification::~OnVIPrndlNotification() { -} +OnVIPrndlNotification::~OnVIPrndlNotification() {} void OnVIPrndlNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -58,4 +56,3 @@ void OnVIPrndlNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_vi_rpm_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_rpm_notification.cc index e9e262b6d5..b5c0703917 100644 --- a/src/components/application_manager/src/commands/hmi/on_vi_rpm_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_vi_rpm_notification.cc @@ -39,11 +39,9 @@ namespace commands { OnVIRpmNotification::OnVIRpmNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnVIRpmNotification::~OnVIRpmNotification() { -} +OnVIRpmNotification::~OnVIRpmNotification() {} void OnVIRpmNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -58,4 +56,3 @@ void OnVIRpmNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_vi_speed_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_speed_notification.cc index a875b168c7..aacafb71c9 100644 --- a/src/components/application_manager/src/commands/hmi/on_vi_speed_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_vi_speed_notification.cc @@ -39,11 +39,9 @@ namespace commands { OnVISpeedNotification::OnVISpeedNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnVISpeedNotification::~OnVISpeedNotification() { -} +OnVISpeedNotification::~OnVISpeedNotification() {} void OnVISpeedNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -58,4 +56,3 @@ void OnVISpeedNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc index f51fce263b..af102ea926 100644 --- a/src/components/application_manager/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_vi_steering_wheel_angle_notification.cc @@ -39,11 +39,9 @@ namespace commands { OnVISteeringWheelAngleNotification::OnVISteeringWheelAngleNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnVISteeringWheelAngleNotification::~OnVISteeringWheelAngleNotification() { -} +OnVISteeringWheelAngleNotification::~OnVISteeringWheelAngleNotification() {} void OnVISteeringWheelAngleNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -58,4 +56,3 @@ void OnVISteeringWheelAngleNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_vi_tire_pressure_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_tire_pressure_notification.cc index 8e77c98c4f..99506e6171 100644 --- a/src/components/application_manager/src/commands/hmi/on_vi_tire_pressure_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_vi_tire_pressure_notification.cc @@ -39,11 +39,9 @@ namespace commands { OnVITirePressureNotification::OnVITirePressureNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnVITirePressureNotification::~OnVITirePressureNotification() { -} +OnVITirePressureNotification::~OnVITirePressureNotification() {} void OnVITirePressureNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -58,4 +56,3 @@ void OnVITirePressureNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_vi_vehicle_data_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_vehicle_data_notification.cc index 7b5fa3cc4f..5f8109ccab 100644 --- a/src/components/application_manager/src/commands/hmi/on_vi_vehicle_data_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_vi_vehicle_data_notification.cc @@ -39,11 +39,9 @@ namespace commands { OnVIVehicleDataNotification::OnVIVehicleDataNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnVIVehicleDataNotification::~OnVIVehicleDataNotification() { -} +OnVIVehicleDataNotification::~OnVIVehicleDataNotification() {} void OnVIVehicleDataNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -58,4 +56,3 @@ void OnVIVehicleDataNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_vi_vin_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_vin_notification.cc index 330e91bf3b..c360e41dff 100644 --- a/src/components/application_manager/src/commands/hmi/on_vi_vin_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_vi_vin_notification.cc @@ -39,11 +39,9 @@ namespace commands { OnVIVinNotification::OnVIVinNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnVIVinNotification::~OnVIVinNotification() { -} +OnVIVinNotification::~OnVIVinNotification() {} void OnVIVinNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -58,4 +56,3 @@ void OnVIVinNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_vi_wiper_status_notification.cc b/src/components/application_manager/src/commands/hmi/on_vi_wiper_status_notification.cc index 0b2719ee50..08fb3f31d4 100644 --- a/src/components/application_manager/src/commands/hmi/on_vi_wiper_status_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_vi_wiper_status_notification.cc @@ -39,11 +39,9 @@ namespace commands { OnVIWiperStatusNotification::OnVIWiperStatusNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnVIWiperStatusNotification::~OnVIWiperStatusNotification() { -} +OnVIWiperStatusNotification::~OnVIWiperStatusNotification() {} void OnVIWiperStatusNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -58,4 +56,3 @@ void OnVIWiperStatusNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_video_data_streaming_notification.cc b/src/components/application_manager/src/commands/hmi/on_video_data_streaming_notification.cc index 4af2c2ee1d..ee0a91f5ef 100644 --- a/src/components/application_manager/src/commands/hmi/on_video_data_streaming_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_video_data_streaming_notification.cc @@ -39,11 +39,9 @@ namespace commands { OnVideoDataStreamingNotification::OnVideoDataStreamingNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationToHMI(message, application_manager) { -} + : NotificationToHMI(message, application_manager) {} -OnVideoDataStreamingNotification::~OnVideoDataStreamingNotification() { -} +OnVideoDataStreamingNotification::~OnVideoDataStreamingNotification() {} void OnVideoDataStreamingNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/on_vr_command_notification.cc b/src/components/application_manager/src/commands/hmi/on_vr_command_notification.cc index 0749537e07..c609e2dc0a 100644 --- a/src/components/application_manager/src/commands/hmi/on_vr_command_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_vr_command_notification.cc @@ -46,16 +46,14 @@ namespace commands { OnVRCommandNotification::OnVRCommandNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnVRCommandNotification::~OnVRCommandNotification() { -} +OnVRCommandNotification::~OnVRCommandNotification() {} void OnVRCommandNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); - const uint32_t cmd_id = (*message_)[strings::msg_params][strings::cmd_id] - .asUInt(); + const uint32_t cmd_id = + (*message_)[strings::msg_params][strings::cmd_id].asUInt(); uint32_t max_cmd_id = application_manager_.get_settings().max_cmd_id(); // Check if this is one of standart VR commands (i.e. "Help") @@ -76,8 +74,8 @@ void OnVRCommandNotification::Run() { if (cmd_id == max_cmd_id + 1) { return; } - const uint32_t app_id = (*message_)[strings::msg_params][strings::app_id] - .asUInt(); + const uint32_t app_id = + (*message_)[strings::msg_params][strings::app_id].asUInt(); ApplicationSharedPtr app = application_manager_.application(app_id); if (!app) { LOG4CXX_ERROR(logger_, "NULL pointer"); @@ -104,4 +102,3 @@ void OnVRCommandNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_vr_language_change_notification.cc b/src/components/application_manager/src/commands/hmi/on_vr_language_change_notification.cc index 2412fd8e9f..bbdb55cde6 100644 --- a/src/components/application_manager/src/commands/hmi/on_vr_language_change_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_vr_language_change_notification.cc @@ -43,17 +43,14 @@ namespace commands { OnVRLanguageChangeNotification::OnVRLanguageChangeNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnVRLanguageChangeNotification::~OnVRLanguageChangeNotification() { -} +OnVRLanguageChangeNotification::~OnVRLanguageChangeNotification() {} void OnVRLanguageChangeNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); - HMICapabilities& hmi_capabilities = - application_manager_.hmi_capabilities(); + HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities(); hmi_capabilities.set_active_vr_language( static_cast<hmi_apis::Common_Language::eType>( @@ -73,16 +70,16 @@ void OnVRLanguageChangeNotification::Run() { ApplicationSharedPtr app = *it++; (*message_)[strings::params][strings::connection_key] = app->app_id(); SendNotificationToMobile(message_); - if (static_cast<int32_t>(app->language()) - != (*message_)[strings::msg_params][strings::language].asInt()) { - - application_manager_.state_controller().SetRegularState(app, - mobile_api::HMILevel::HMI_NONE, - false); - - application_manager_.ManageMobileCommand(MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( - app->app_id(), - mobile_api::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE), commands::Command::ORIGIN_SDL); + if (static_cast<int32_t>(app->language()) != + (*message_)[strings::msg_params][strings::language].asInt()) { + application_manager_.state_controller().SetRegularState( + app, mobile_api::HMILevel::HMI_NONE, false); + + application_manager_.ManageMobileCommand( + MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( + app->app_id(), + mobile_api::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE), + commands::Command::ORIGIN_SDL); application_manager_.UnregisterApplication( app->app_id(), mobile_apis::Result::SUCCESS, false); } diff --git a/src/components/application_manager/src/commands/hmi/on_vr_started_notification.cc b/src/components/application_manager/src/commands/hmi/on_vr_started_notification.cc index f87f50f178..68942fcf01 100644 --- a/src/components/application_manager/src/commands/hmi/on_vr_started_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_vr_started_notification.cc @@ -32,18 +32,15 @@ #include "application_manager/commands/hmi/on_vr_started_notification.h" - namespace application_manager { namespace commands { OnVRStartedNotification::OnVRStartedNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnVRStartedNotification::~OnVRStartedNotification() { -} +OnVRStartedNotification::~OnVRStartedNotification() {} void OnVRStartedNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -56,4 +53,3 @@ void OnVRStartedNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/on_vr_stopped_notification.cc b/src/components/application_manager/src/commands/hmi/on_vr_stopped_notification.cc index fa13eb509f..e8f9fab847 100644 --- a/src/components/application_manager/src/commands/hmi/on_vr_stopped_notification.cc +++ b/src/components/application_manager/src/commands/hmi/on_vr_stopped_notification.cc @@ -32,18 +32,15 @@ #include "application_manager/commands/hmi/on_vr_stopped_notification.h" - namespace application_manager { namespace commands { OnVRStoppedNotification::OnVRStoppedNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : NotificationFromHMI(message, application_manager) { -} + : NotificationFromHMI(message, application_manager) {} -OnVRStoppedNotification::~OnVRStoppedNotification() { -} +OnVRStoppedNotification::~OnVRStoppedNotification() {} void OnVRStoppedNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -56,4 +53,3 @@ void OnVRStoppedNotification::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/request_from_hmi.cc b/src/components/application_manager/src/commands/hmi/request_from_hmi.cc index 03a8bcfe8b..be3cd6314c 100644 --- a/src/components/application_manager/src/commands/hmi/request_from_hmi.cc +++ b/src/components/application_manager/src/commands/hmi/request_from_hmi.cc @@ -40,14 +40,13 @@ namespace commands { RequestFromHMI::RequestFromHMI(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandImpl(message, application_manager), - EventObserver(application_manager.event_dispatcher()) { + : CommandImpl(message, application_manager) + , EventObserver(application_manager.event_dispatcher()) { // Replace HMI app id with Mobile connection id ReplaceHMIByMobileAppId(*(message.get())); } -RequestFromHMI::~RequestFromHMI() { -} +RequestFromHMI::~RequestFromHMI() {} bool RequestFromHMI::Init() { return true; @@ -57,18 +56,17 @@ bool RequestFromHMI::CleanUp() { return true; } -void RequestFromHMI::Run() { -} +void RequestFromHMI::Run() {} -void RequestFromHMI::on_event(const event_engine::Event& event) { -} +void RequestFromHMI::on_event(const event_engine::Event& 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) { - smart_objects::SmartObject* message = new smart_objects::SmartObject( - smart_objects::SmartType_Map); +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) { + smart_objects::SmartObject* message = + new 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; @@ -78,30 +76,31 @@ void RequestFromHMI::SendResponse(const bool success, application_manager_.ManageHMICommand(message); } -//void RequestFromHMI::SendErrorResponse(uint32_t correlation_id, -// hmi_apis::FunctionID::eType function_id, -// hmi_apis::Common_Result::eType result_code) { +// void RequestFromHMI::SendErrorResponse(uint32_t correlation_id, +// hmi_apis::FunctionID::eType +// function_id, +// hmi_apis::Common_Result::eType +// result_code) { // smart_objects::SmartObject* message = new smart_objects::SmartObject( // smart_objects::SmartType_Map); // FillCommonParametersOfSO(message, correlation_id, function_id); -// (*message)[strings::params][strings::message_type] = MessageType::kErrorResponse; +// (*message)[strings::params][strings::message_type] = +// MessageType::kErrorResponse; // (*message)[strings::params][hmi_response::code] = result_code; // (*message)[strings::params][strings::error_msg] = "HMIDeactivate is active"; // application_manager_.ManageHMICommand(message); //} -void RequestFromHMI::FillCommonParametersOfSO(smart_objects::SmartObject* message, - uint32_t correlation_id, - hmi_apis::FunctionID::eType function_id) { - +void RequestFromHMI::FillCommonParametersOfSO( + smart_objects::SmartObject* message, + uint32_t correlation_id, + hmi_apis::FunctionID::eType function_id) { (*message)[strings::params][strings::function_id] = function_id; (*message)[strings::params][strings::protocol_type] = hmi_protocol_type_; (*message)[strings::params][strings::protocol_version] = protocol_version_; (*message)[strings::params][strings::correlation_id] = correlation_id; } - } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/request_to_hmi.cc b/src/components/application_manager/src/commands/hmi/request_to_hmi.cc index adb3e0764b..2e7d7e9df1 100644 --- a/src/components/application_manager/src/commands/hmi/request_to_hmi.cc +++ b/src/components/application_manager/src/commands/hmi/request_to_hmi.cc @@ -32,8 +32,6 @@ #include "application_manager/commands/hmi/request_to_hmi.h" - - namespace application_manager { namespace commands { @@ -45,8 +43,7 @@ RequestToHMI::RequestToHMI(const MessageSharedPtr& message, ReplaceMobileByHMIAppId(*(message.get())); } -RequestToHMI::~RequestToHMI() { -} +RequestToHMI::~RequestToHMI() {} bool RequestToHMI::Init() { return true; @@ -56,8 +53,7 @@ bool RequestToHMI::CleanUp() { return true; } -void RequestToHMI::Run() { -} +void RequestToHMI::Run() {} void RequestToHMI::SendRequest() { (*message_)[strings::params][strings::protocol_type] = hmi_protocol_type_; diff --git a/src/components/application_manager/src/commands/hmi/response_from_hmi.cc b/src/components/application_manager/src/commands/hmi/response_from_hmi.cc index 9dd4862aac..23d8e6e229 100644 --- a/src/components/application_manager/src/commands/hmi/response_from_hmi.cc +++ b/src/components/application_manager/src/commands/hmi/response_from_hmi.cc @@ -51,8 +51,7 @@ ResponseFromHMI::ResponseFromHMI(const MessageSharedPtr& message, ReplaceHMIByMobileAppId(*(message.get())); } -ResponseFromHMI::~ResponseFromHMI() { -} +ResponseFromHMI::~ResponseFromHMI() {} bool ResponseFromHMI::Init() { return true; @@ -62,10 +61,10 @@ bool ResponseFromHMI::CleanUp() { return true; } -void ResponseFromHMI::Run() { -} +void ResponseFromHMI::Run() {} -void ResponseFromHMI::SendResponseToMobile(const MessageSharedPtr& message, ApplicationManager& application_manager) { +void ResponseFromHMI::SendResponseToMobile( + const MessageSharedPtr& message, ApplicationManager& application_manager) { (*message)[strings::params][strings::message_type] = MessageType::kResponse; application_manager_.ManageMobileCommand(message, ORIGIN_SDL); @@ -74,7 +73,6 @@ void ResponseFromHMI::SendResponseToMobile(const MessageSharedPtr& message, Appl void ResponseFromHMI::CreateHMIRequest( const hmi_apis::FunctionID::eType& function_id, const smart_objects::SmartObject& msg_params) const { - smart_objects::SmartObjectSPtr result = new smart_objects::SmartObject; if (!result) { @@ -83,7 +81,8 @@ void ResponseFromHMI::CreateHMIRequest( } // get hmi correlation id for chaining further request from this object - const uint32_t hmi_correlation_id_ = application_manager_.GetNextHMICorrelationID(); + const uint32_t hmi_correlation_id_ = + application_manager_.GetNextHMICorrelationID(); NsSmartDeviceLink::NsSmartObjects::SmartObject& request = *result; request[strings::params][strings::message_type] = MessageType::kRequest; diff --git a/src/components/application_manager/src/commands/hmi/response_to_hmi.cc b/src/components/application_manager/src/commands/hmi/response_to_hmi.cc index 0b9ea5a768..e6f64047ba 100644 --- a/src/components/application_manager/src/commands/hmi/response_to_hmi.cc +++ b/src/components/application_manager/src/commands/hmi/response_to_hmi.cc @@ -44,8 +44,7 @@ ResponseToHMI::ResponseToHMI(const MessageSharedPtr& message, ReplaceMobileByHMIAppId(*(message.get())); } -ResponseToHMI::~ResponseToHMI() { -} +ResponseToHMI::~ResponseToHMI() {} bool ResponseToHMI::Init() { return true; @@ -64,4 +63,3 @@ void ResponseToHMI::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc b/src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc index 96864cbf6b..b3e7a968eb 100644 --- a/src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc +++ b/src/components/application_manager/src/commands/hmi/sdl_activate_app_request.cc @@ -38,12 +38,11 @@ namespace application_manager { namespace commands { -SDLActivateAppRequest::SDLActivateAppRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestFromHMI(message, application_manager) { -} +SDLActivateAppRequest::SDLActivateAppRequest( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : RequestFromHMI(message, application_manager) {} -SDLActivateAppRequest::~SDLActivateAppRequest() { -} +SDLActivateAppRequest::~SDLActivateAppRequest() {} void SDLActivateAppRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -73,14 +72,18 @@ void SDLActivateAppRequest::Run() { if (!app->IsRegistered()) { if (devices_apps.first) { - MessageHelper::SendLaunchApp( - devices_apps.first->app_id(), app->SchemaUrl(), app->PackageName(), application_manager_); + MessageHelper::SendLaunchApp(devices_apps.first->app_id(), + app->SchemaUrl(), + app->PackageName(), + application_manager_); } else { std::vector<ApplicationSharedPtr>::const_iterator it = devices_apps.second.begin(); for (; it != devices_apps.second.end(); ++it) { - MessageHelper::SendLaunchApp( - (*it)->app_id(), app->SchemaUrl(), app->PackageName(), application_manager_); + MessageHelper::SendLaunchApp((*it)->app_id(), + app->SchemaUrl(), + app->PackageName(), + application_manager_); } } subscribe_on_event(BasicCommunication_OnAppRegistered); @@ -91,9 +94,9 @@ void SDLActivateAppRequest::Run() { app->PackageName(), application_manager_); } else { - const uint32_t application_id = app_id(); - application_manager_.GetPolicyHandler().OnActivateApp(application_id, - correlation_id()); + const uint32_t application_id = app_id(); + application_manager_.GetPolicyHandler().OnActivateApp(application_id, + correlation_id()); } } } @@ -103,7 +106,8 @@ void SDLActivateAppRequest::onTimeOut() { using namespace hmi_apis::Common_Result; using namespace application_manager; unsubscribe_from_event(BasicCommunication_OnAppRegistered); - SendResponse(false, correlation_id(), SDL_ActivateApp, APPLICATION_NOT_REGISTERED); + SendResponse( + false, correlation_id(), SDL_ActivateApp, APPLICATION_NOT_REGISTERED); } void SDLActivateAppRequest::on_event(const event_engine::Event& event) { @@ -125,15 +129,14 @@ void SDLActivateAppRequest::on_event(const event_engine::Event& event) { logger_, "Application not found by HMI app id: " << hmi_application_id); return; } - application_manager_.GetPolicyHandler() - .OnActivateApp(app->app_id(), correlation_id()); + application_manager_.GetPolicyHandler().OnActivateApp(app->app_id(), + correlation_id()); } uint32_t SDLActivateAppRequest::app_id() const { - if ((*message_).keyExists(strings::msg_params)) { - if ((*message_)[strings::msg_params].keyExists(strings::app_id)){ - return (*message_)[strings::msg_params][strings::app_id].asUInt(); + if ((*message_)[strings::msg_params].keyExists(strings::app_id)) { + return (*message_)[strings::msg_params][strings::app_id].asUInt(); } } LOG4CXX_DEBUG(logger_, "app_id section is absent in the message."); diff --git a/src/components/application_manager/src/commands/hmi/sdl_activate_app_response.cc b/src/components/application_manager/src/commands/hmi/sdl_activate_app_response.cc index dd0a7faae9..75a8c0b241 100644 --- a/src/components/application_manager/src/commands/hmi/sdl_activate_app_response.cc +++ b/src/components/application_manager/src/commands/hmi/sdl_activate_app_response.cc @@ -32,17 +32,15 @@ #include "application_manager/commands/hmi/sdl_activate_app_response.h" - namespace application_manager { namespace commands { SDLActivateAppResponse::SDLActivateAppResponse( - const MessageSharedPtr& message, ApplicationManager& application_manager): ResponseToHMI(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : ResponseToHMI(message, application_manager) {} -SDLActivateAppResponse::~SDLActivateAppResponse() { -} +SDLActivateAppResponse::~SDLActivateAppResponse() {} void SDLActivateAppResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -54,5 +52,3 @@ void SDLActivateAppResponse::Run() { } // namespace commands } // namespace application_manager - - diff --git a/src/components/application_manager/src/commands/hmi/sdl_get_list_of_permissions_request.cc b/src/components/application_manager/src/commands/hmi/sdl_get_list_of_permissions_request.cc index 693cb83392..4b150cda60 100644 --- a/src/components/application_manager/src/commands/hmi/sdl_get_list_of_permissions_request.cc +++ b/src/components/application_manager/src/commands/hmi/sdl_get_list_of_permissions_request.cc @@ -39,11 +39,9 @@ namespace commands { SDLGetListOfPermissionsRequest::SDLGetListOfPermissionsRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestFromHMI(message, application_manager) { -} + : RequestFromHMI(message, application_manager) {} -SDLGetListOfPermissionsRequest::~SDLGetListOfPermissionsRequest() { -} +SDLGetListOfPermissionsRequest::~SDLGetListOfPermissionsRequest() {} void SDLGetListOfPermissionsRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,11 +50,9 @@ void SDLGetListOfPermissionsRequest::Run() { connection_key = (*message_)[strings::msg_params][strings::app_id].asUInt(); } application_manager_.GetPolicyHandler().OnGetListOfPermissions( - connection_key, - (*message_)[strings::params][strings::correlation_id].asUInt()); + connection_key, + (*message_)[strings::params][strings::correlation_id].asUInt()); } } // namespace commands } // namespace application_manager - - diff --git a/src/components/application_manager/src/commands/hmi/sdl_get_list_of_permissions_response.cc b/src/components/application_manager/src/commands/hmi/sdl_get_list_of_permissions_response.cc index bd8b7c011d..521b59a0ec 100644 --- a/src/components/application_manager/src/commands/hmi/sdl_get_list_of_permissions_response.cc +++ b/src/components/application_manager/src/commands/hmi/sdl_get_list_of_permissions_response.cc @@ -32,17 +32,15 @@ #include "application_manager/commands/hmi/sdl_get_list_of_permissions_response.h" - namespace application_manager { namespace commands { SDLGetListOfPermissionsResponse::SDLGetListOfPermissionsResponse( - const MessageSharedPtr& message, ApplicationManager& application_manager): ResponseToHMI(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : ResponseToHMI(message, application_manager) {} -SDLGetListOfPermissionsResponse::~SDLGetListOfPermissionsResponse() { -} +SDLGetListOfPermissionsResponse::~SDLGetListOfPermissionsResponse() {} void SDLGetListOfPermissionsResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -54,5 +52,3 @@ void SDLGetListOfPermissionsResponse::Run() { } // namespace commands } // namespace application_manager - - diff --git a/src/components/application_manager/src/commands/hmi/sdl_get_status_update_request.cc b/src/components/application_manager/src/commands/hmi/sdl_get_status_update_request.cc index a3829111d5..afa7569746 100644 --- a/src/components/application_manager/src/commands/hmi/sdl_get_status_update_request.cc +++ b/src/components/application_manager/src/commands/hmi/sdl_get_status_update_request.cc @@ -37,20 +37,17 @@ namespace application_manager { namespace commands { -SDLGetStatusUpdateRequest::SDLGetStatusUpdateRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestFromHMI(message, application_manager) { -} +SDLGetStatusUpdateRequest::SDLGetStatusUpdateRequest( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : RequestFromHMI(message, application_manager) {} -SDLGetStatusUpdateRequest::~SDLGetStatusUpdateRequest() { -} +SDLGetStatusUpdateRequest::~SDLGetStatusUpdateRequest() {} void SDLGetStatusUpdateRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); application_manager_.GetPolicyHandler().OnGetStatusUpdate( - (*message_)[strings::params][strings::correlation_id].asUInt()); + (*message_)[strings::params][strings::correlation_id].asUInt()); } } // namespace commands } // namespace application_manager - - diff --git a/src/components/application_manager/src/commands/hmi/sdl_get_status_update_response.cc b/src/components/application_manager/src/commands/hmi/sdl_get_status_update_response.cc index 2108b8856d..0af7e0217a 100644 --- a/src/components/application_manager/src/commands/hmi/sdl_get_status_update_response.cc +++ b/src/components/application_manager/src/commands/hmi/sdl_get_status_update_response.cc @@ -32,17 +32,15 @@ #include "application_manager/commands/hmi/sdl_get_status_update_response.h" - namespace application_manager { namespace commands { SDLGetStatusUpdateResponse::SDLGetStatusUpdateResponse( - const MessageSharedPtr& message, ApplicationManager& application_manager): ResponseToHMI(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : ResponseToHMI(message, application_manager) {} -SDLGetStatusUpdateResponse::~SDLGetStatusUpdateResponse() { -} +SDLGetStatusUpdateResponse::~SDLGetStatusUpdateResponse() {} void SDLGetStatusUpdateResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -54,6 +52,3 @@ void SDLGetStatusUpdateResponse::Run() { } // namespace commands } // namespace application_manager - - - diff --git a/src/components/application_manager/src/commands/hmi/sdl_get_user_friendly_message_request.cc b/src/components/application_manager/src/commands/hmi/sdl_get_user_friendly_message_request.cc index d8f9fbdeb9..ea959389ef 100644 --- a/src/components/application_manager/src/commands/hmi/sdl_get_user_friendly_message_request.cc +++ b/src/components/application_manager/src/commands/hmi/sdl_get_user_friendly_message_request.cc @@ -39,18 +39,16 @@ namespace commands { SDLGetUserFriendlyMessageRequest::SDLGetUserFriendlyMessageRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestFromHMI(message, application_manager) { -} + : RequestFromHMI(message, application_manager) {} -SDLGetUserFriendlyMessageRequest::~SDLGetUserFriendlyMessageRequest() { -} +SDLGetUserFriendlyMessageRequest::~SDLGetUserFriendlyMessageRequest() {} void SDLGetUserFriendlyMessageRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); const std::string messageCodes = "messageCodes"; if (!(*message_)[strings::msg_params].keyExists(messageCodes)) { LOG4CXX_WARN(logger_, - "Mandatory parameter '"+messageCodes+"'' is missing"); + "Mandatory parameter '" + messageCodes + "'' is missing"); return; } smart_objects::SmartArray* msg = @@ -66,24 +64,24 @@ void SDLGetUserFriendlyMessageRequest::Run() { std::string required_language; if ((*message_)[strings::msg_params].keyExists(strings::language)) { - uint32_t lang_code = (*message_)[strings::msg_params][strings::language] - .asUInt(); + uint32_t lang_code = + (*message_)[strings::msg_params][strings::language].asUInt(); required_language = application_manager::MessageHelper::CommonLanguageToString( - static_cast<hmi_apis::Common_Language::eType>(lang_code)); + static_cast<hmi_apis::Common_Language::eType>(lang_code)); } else { - hmi_apis::Common_Language::eType ui_language = application_manager_.hmi_capabilities().active_ui_language(); + hmi_apis::Common_Language::eType ui_language = + application_manager_.hmi_capabilities().active_ui_language(); required_language = application_manager::MessageHelper::CommonLanguageToString(ui_language); } - application_manager_.GetPolicyHandler().OnGetUserFriendlyMessage( - msg_codes, required_language, - (*message_)[strings::params][strings::correlation_id].asInt()); + application_manager_.GetPolicyHandler().OnGetUserFriendlyMessage( + msg_codes, + required_language, + (*message_)[strings::params][strings::correlation_id].asInt()); } } // namespace commands } // namespace application_manager - - diff --git a/src/components/application_manager/src/commands/hmi/sdl_get_user_friendly_message_response.cc b/src/components/application_manager/src/commands/hmi/sdl_get_user_friendly_message_response.cc index b4e6549bb2..c693625dbb 100644 --- a/src/components/application_manager/src/commands/hmi/sdl_get_user_friendly_message_response.cc +++ b/src/components/application_manager/src/commands/hmi/sdl_get_user_friendly_message_response.cc @@ -32,17 +32,15 @@ #include "application_manager/commands/hmi/sdl_get_user_friendly_message_response.h" - namespace application_manager { namespace commands { SDLGetUserFriendlyMessageResponse::SDLGetUserFriendlyMessageResponse( - const MessageSharedPtr& message, ApplicationManager& application_manager): ResponseToHMI(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : ResponseToHMI(message, application_manager) {} -SDLGetUserFriendlyMessageResponse::~SDLGetUserFriendlyMessageResponse() { -} +SDLGetUserFriendlyMessageResponse::~SDLGetUserFriendlyMessageResponse() {} void SDLGetUserFriendlyMessageResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -54,5 +52,3 @@ void SDLGetUserFriendlyMessageResponse::Run() { } // namespace commands } // namespace application_manager - - diff --git a/src/components/application_manager/src/commands/hmi/sdl_policy_update.cc b/src/components/application_manager/src/commands/hmi/sdl_policy_update.cc index 4649f86cfe..88b7c3faae 100644 --- a/src/components/application_manager/src/commands/hmi/sdl_policy_update.cc +++ b/src/components/application_manager/src/commands/hmi/sdl_policy_update.cc @@ -36,12 +36,11 @@ namespace application_manager { namespace commands { -SDLPolicyUpdate::SDLPolicyUpdate( - const MessageSharedPtr& message, ApplicationManager& application_manager): RequestToHMI(message, application_manager) { -} +SDLPolicyUpdate::SDLPolicyUpdate(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -SDLPolicyUpdate::~SDLPolicyUpdate() { -} +SDLPolicyUpdate::~SDLPolicyUpdate() {} void SDLPolicyUpdate::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/sdl_policy_update_response.cc b/src/components/application_manager/src/commands/hmi/sdl_policy_update_response.cc index f15ec9123d..38b57a5b9f 100644 --- a/src/components/application_manager/src/commands/hmi/sdl_policy_update_response.cc +++ b/src/components/application_manager/src/commands/hmi/sdl_policy_update_response.cc @@ -36,11 +36,10 @@ namespace application_manager { namespace commands { SDLPolicyUpdateResponse::SDLPolicyUpdateResponse( - const MessageSharedPtr& message, ApplicationManager& application_manager): ResponseFromHMI(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -SDLPolicyUpdateResponse::~SDLPolicyUpdateResponse() { -} +SDLPolicyUpdateResponse::~SDLPolicyUpdateResponse() {} void SDLPolicyUpdateResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/tts_change_registration_request.cc b/src/components/application_manager/src/commands/hmi/tts_change_registration_request.cc index 65d11922c2..bb1f29d889 100644 --- a/src/components/application_manager/src/commands/hmi/tts_change_registration_request.cc +++ b/src/components/application_manager/src/commands/hmi/tts_change_registration_request.cc @@ -38,11 +38,9 @@ namespace commands { TTSChangeRegistrationRequest::TTSChangeRegistrationRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} + : RequestToHMI(message, application_manager) {} -TTSChangeRegistrationRequest::~TTSChangeRegistrationRequest() { -} +TTSChangeRegistrationRequest::~TTSChangeRegistrationRequest() {} void TTSChangeRegistrationRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -53,4 +51,3 @@ void TTSChangeRegistrationRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/tts_change_registration_response.cc b/src/components/application_manager/src/commands/hmi/tts_change_registration_response.cc index e5582a1edc..e63ee5f74d 100644 --- a/src/components/application_manager/src/commands/hmi/tts_change_registration_response.cc +++ b/src/components/application_manager/src/commands/hmi/tts_change_registration_response.cc @@ -40,11 +40,9 @@ namespace commands { TTSChangeRegistratioResponse::TTSChangeRegistratioResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} + : ResponseFromHMI(message, application_manager) {} -TTSChangeRegistratioResponse::~TTSChangeRegistratioResponse() { -} +TTSChangeRegistratioResponse::~TTSChangeRegistratioResponse() {} void TTSChangeRegistratioResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/tts_get_capabilities_request.cc b/src/components/application_manager/src/commands/hmi/tts_get_capabilities_request.cc index 4892c6889a..4dbf5e8ee7 100644 --- a/src/components/application_manager/src/commands/hmi/tts_get_capabilities_request.cc +++ b/src/components/application_manager/src/commands/hmi/tts_get_capabilities_request.cc @@ -38,11 +38,9 @@ namespace commands { TTSGetCapabilitiesRequest::TTSGetCapabilitiesRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} + : RequestToHMI(message, application_manager) {} -TTSGetCapabilitiesRequest::~TTSGetCapabilitiesRequest() { -} +TTSGetCapabilitiesRequest::~TTSGetCapabilitiesRequest() {} void TTSGetCapabilitiesRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -53,4 +51,3 @@ void TTSGetCapabilitiesRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/tts_get_capabilities_response.cc b/src/components/application_manager/src/commands/hmi/tts_get_capabilities_response.cc index 8722979a51..ce629b36d7 100644 --- a/src/components/application_manager/src/commands/hmi/tts_get_capabilities_response.cc +++ b/src/components/application_manager/src/commands/hmi/tts_get_capabilities_response.cc @@ -31,35 +31,31 @@ */ #include "application_manager/commands/hmi/tts_get_capabilities_response.h" - namespace application_manager { namespace commands { TTSGetCapabilitiesResponse::TTSGetCapabilitiesResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} + : ResponseFromHMI(message, application_manager) {} -TTSGetCapabilitiesResponse::~TTSGetCapabilitiesResponse() { -} +TTSGetCapabilitiesResponse::~TTSGetCapabilitiesResponse() {} void TTSGetCapabilitiesResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); - HMICapabilities& hmi_capabilities = - application_manager_.hmi_capabilities(); - if ((*message_)[strings::msg_params].keyExists(hmi_response::speech_capabilities)) { + HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities(); + if ((*message_)[strings::msg_params].keyExists( + hmi_response::speech_capabilities)) { hmi_capabilities.set_speech_capabilities( - (*message_)[strings::msg_params][hmi_response::speech_capabilities]); + (*message_)[strings::msg_params][hmi_response::speech_capabilities]); } if ((*message_)[strings::msg_params].keyExists( - hmi_response::prerecorded_speech_capabilities)) { + hmi_response::prerecorded_speech_capabilities)) { hmi_capabilities.set_prerecorded_speech( (*message_)[strings::msg_params] - [hmi_response::prerecorded_speech_capabilities]); + [hmi_response::prerecorded_speech_capabilities]); } - } } // namespace commands diff --git a/src/components/application_manager/src/commands/hmi/tts_get_language_request.cc b/src/components/application_manager/src/commands/hmi/tts_get_language_request.cc index e55e5e7fdc..c44667a223 100644 --- a/src/components/application_manager/src/commands/hmi/tts_get_language_request.cc +++ b/src/components/application_manager/src/commands/hmi/tts_get_language_request.cc @@ -36,12 +36,11 @@ namespace application_manager { namespace commands { -TTSGetLanguageRequest::TTSGetLanguageRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} +TTSGetLanguageRequest::TTSGetLanguageRequest( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -TTSGetLanguageRequest::~TTSGetLanguageRequest() { -} +TTSGetLanguageRequest::~TTSGetLanguageRequest() {} void TTSGetLanguageRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,4 +51,3 @@ void TTSGetLanguageRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/tts_get_language_response.cc b/src/components/application_manager/src/commands/hmi/tts_get_language_response.cc index 49e7e6d5d1..37aed2c6cb 100644 --- a/src/components/application_manager/src/commands/hmi/tts_get_language_response.cc +++ b/src/components/application_manager/src/commands/hmi/tts_get_language_response.cc @@ -37,12 +37,11 @@ namespace application_manager { namespace commands { -TTSGetLanguageResponse::TTSGetLanguageResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} +TTSGetLanguageResponse::TTSGetLanguageResponse( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -TTSGetLanguageResponse::~TTSGetLanguageResponse() { -} +TTSGetLanguageResponse::~TTSGetLanguageResponse() {} void TTSGetLanguageResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,17 +51,16 @@ void TTSGetLanguageResponse::Run() { if ((*message_).keyExists(strings::msg_params) && (*message_)[strings::msg_params].keyExists(hmi_response::language)) { - language = static_cast<Common_Language::eType>( - (*message_)[strings::msg_params][hmi_response::language].asInt()); + (*message_)[strings::msg_params][hmi_response::language].asInt()); } - application_manager_.hmi_capabilities(). - set_active_tts_language(language); + application_manager_.hmi_capabilities().set_active_tts_language(language); - LOG4CXX_DEBUG(logger_, "Raising event for function_id " - << function_id() - << " and correlation_id " << correlation_id()); + LOG4CXX_DEBUG(logger_, + "Raising event for function_id " << function_id() + << " and correlation_id " + << correlation_id()); event_engine::Event event(FunctionID::TTS_GetLanguage); event.set_smart_object(*message_); event.raise(application_manager_.event_dispatcher()); diff --git a/src/components/application_manager/src/commands/hmi/tts_get_supported_languages_request.cc b/src/components/application_manager/src/commands/hmi/tts_get_supported_languages_request.cc index a87b31072d..941adca01d 100644 --- a/src/components/application_manager/src/commands/hmi/tts_get_supported_languages_request.cc +++ b/src/components/application_manager/src/commands/hmi/tts_get_supported_languages_request.cc @@ -38,11 +38,9 @@ namespace commands { TTSGetSupportedLanguagesRequest::TTSGetSupportedLanguagesRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} + : RequestToHMI(message, application_manager) {} -TTSGetSupportedLanguagesRequest::~TTSGetSupportedLanguagesRequest() { -} +TTSGetSupportedLanguagesRequest::~TTSGetSupportedLanguagesRequest() {} void TTSGetSupportedLanguagesRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -53,4 +51,3 @@ void TTSGetSupportedLanguagesRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/tts_get_supported_languages_response.cc b/src/components/application_manager/src/commands/hmi/tts_get_supported_languages_response.cc index 3e34acacdf..79af1d3cc2 100644 --- a/src/components/application_manager/src/commands/hmi/tts_get_supported_languages_response.cc +++ b/src/components/application_manager/src/commands/hmi/tts_get_supported_languages_response.cc @@ -39,11 +39,9 @@ namespace commands { TTSGetSupportedLanguagesResponse::TTSGetSupportedLanguagesResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} + : ResponseFromHMI(message, application_manager) {} -TTSGetSupportedLanguagesResponse::~TTSGetSupportedLanguagesResponse() { -} +TTSGetSupportedLanguagesResponse::~TTSGetSupportedLanguagesResponse() {} void TTSGetSupportedLanguagesResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -53,8 +51,7 @@ void TTSGetSupportedLanguagesResponse::Run() { (*message_)[strings::params][hmi_response::code].asInt()); if (hmi_apis::Common_Result::SUCCESS == code) { - HMICapabilities& hmi_capabilities = - application_manager_.hmi_capabilities(); + HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities(); hmi_capabilities.set_tts_supported_languages( (*message_)[strings::msg_params][hmi_response::languages]); diff --git a/src/components/application_manager/src/commands/hmi/tts_is_ready_request.cc b/src/components/application_manager/src/commands/hmi/tts_is_ready_request.cc index 39d20b20df..e7fd335808 100644 --- a/src/components/application_manager/src/commands/hmi/tts_is_ready_request.cc +++ b/src/components/application_manager/src/commands/hmi/tts_is_ready_request.cc @@ -36,12 +36,11 @@ namespace application_manager { namespace commands { -TTSIsReadyRequest::TTSIsReadyRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} +TTSIsReadyRequest::TTSIsReadyRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -TTSIsReadyRequest::~TTSIsReadyRequest() { -} +TTSIsReadyRequest::~TTSIsReadyRequest() {} void TTSIsReadyRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,4 +51,3 @@ void TTSIsReadyRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/tts_is_ready_response.cc b/src/components/application_manager/src/commands/hmi/tts_is_ready_response.cc index 332a139f55..91efb293c9 100644 --- a/src/components/application_manager/src/commands/hmi/tts_is_ready_response.cc +++ b/src/components/application_manager/src/commands/hmi/tts_is_ready_response.cc @@ -31,17 +31,15 @@ */ #include "application_manager/commands/hmi/tts_is_ready_response.h" - namespace application_manager { namespace commands { -TTSIsReadyResponse::TTSIsReadyResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} +TTSIsReadyResponse::TTSIsReadyResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -TTSIsReadyResponse::~TTSIsReadyResponse() { -} +TTSIsReadyResponse::~TTSIsReadyResponse() {} void TTSIsReadyResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,8 +50,7 @@ void TTSIsReadyResponse::Run() { is_available = object[strings::msg_params][strings::available].asBool(); } - HMICapabilities& hmi_capabilities = - application_manager_.hmi_capabilities(); + HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities(); hmi_capabilities.set_is_tts_cooperating(is_available); } diff --git a/src/components/application_manager/src/commands/hmi/tts_set_global_properties_request.cc b/src/components/application_manager/src/commands/hmi/tts_set_global_properties_request.cc index 6139df4eaf..bf035ffe23 100644 --- a/src/components/application_manager/src/commands/hmi/tts_set_global_properties_request.cc +++ b/src/components/application_manager/src/commands/hmi/tts_set_global_properties_request.cc @@ -38,11 +38,9 @@ namespace commands { TTSSetGlobalPropertiesRequest::TTSSetGlobalPropertiesRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} + : RequestToHMI(message, application_manager) {} -TTSSetGlobalPropertiesRequest::~TTSSetGlobalPropertiesRequest() { -} +TTSSetGlobalPropertiesRequest::~TTSSetGlobalPropertiesRequest() {} void TTSSetGlobalPropertiesRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -53,4 +51,3 @@ void TTSSetGlobalPropertiesRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/tts_set_global_properties_response.cc b/src/components/application_manager/src/commands/hmi/tts_set_global_properties_response.cc index 3ab850493f..f494fb1a8e 100644 --- a/src/components/application_manager/src/commands/hmi/tts_set_global_properties_response.cc +++ b/src/components/application_manager/src/commands/hmi/tts_set_global_properties_response.cc @@ -40,11 +40,9 @@ namespace commands { TTSSetGlobalPropertiesResponse::TTSSetGlobalPropertiesResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} + : ResponseFromHMI(message, application_manager) {} -TTSSetGlobalPropertiesResponse::~TTSSetGlobalPropertiesResponse() { -} +TTSSetGlobalPropertiesResponse::~TTSSetGlobalPropertiesResponse() {} void TTSSetGlobalPropertiesResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/tts_speak_request.cc b/src/components/application_manager/src/commands/hmi/tts_speak_request.cc index eaddeb2a18..2e386449d0 100644 --- a/src/components/application_manager/src/commands/hmi/tts_speak_request.cc +++ b/src/components/application_manager/src/commands/hmi/tts_speak_request.cc @@ -36,12 +36,11 @@ namespace application_manager { namespace commands { -TTSSpeakRequest::TTSSpeakRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} +TTSSpeakRequest::TTSSpeakRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -TTSSpeakRequest::~TTSSpeakRequest() { -} +TTSSpeakRequest::~TTSSpeakRequest() {} void TTSSpeakRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,4 +51,3 @@ void TTSSpeakRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/tts_speak_response.cc b/src/components/application_manager/src/commands/hmi/tts_speak_response.cc index b0c55b2f7a..5cffdccf34 100644 --- a/src/components/application_manager/src/commands/hmi/tts_speak_response.cc +++ b/src/components/application_manager/src/commands/hmi/tts_speak_response.cc @@ -39,12 +39,11 @@ namespace application_manager { namespace commands { -TTSSpeakResponse::TTSSpeakResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} +TTSSpeakResponse::TTSSpeakResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -TTSSpeakResponse::~TTSSpeakResponse() { -} +TTSSpeakResponse::~TTSSpeakResponse() {} void TTSSpeakResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/tts_stop_speaking_request.cc b/src/components/application_manager/src/commands/hmi/tts_stop_speaking_request.cc index 903a474b55..c2275dda72 100644 --- a/src/components/application_manager/src/commands/hmi/tts_stop_speaking_request.cc +++ b/src/components/application_manager/src/commands/hmi/tts_stop_speaking_request.cc @@ -36,12 +36,11 @@ namespace application_manager { namespace commands { -TTSStopSpeakingRequest::TTSStopSpeakingRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} +TTSStopSpeakingRequest::TTSStopSpeakingRequest( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -TTSStopSpeakingRequest::~TTSStopSpeakingRequest() { -} +TTSStopSpeakingRequest::~TTSStopSpeakingRequest() {} void TTSStopSpeakingRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,4 +51,3 @@ void TTSStopSpeakingRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/tts_stop_speaking_response.cc b/src/components/application_manager/src/commands/hmi/tts_stop_speaking_response.cc index 5e8e286e9b..67d747f464 100644 --- a/src/components/application_manager/src/commands/hmi/tts_stop_speaking_response.cc +++ b/src/components/application_manager/src/commands/hmi/tts_stop_speaking_response.cc @@ -39,11 +39,9 @@ namespace commands { TTSStopSpeakingResponse::TTSStopSpeakingResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} + : ResponseFromHMI(message, application_manager) {} -TTSStopSpeakingResponse::~TTSStopSpeakingResponse() { -} +TTSStopSpeakingResponse::~TTSStopSpeakingResponse() {} void TTSStopSpeakingResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/ui_add_command_request.cc b/src/components/application_manager/src/commands/hmi/ui_add_command_request.cc index 84d18e8667..c0edad3f80 100644 --- a/src/components/application_manager/src/commands/hmi/ui_add_command_request.cc +++ b/src/components/application_manager/src/commands/hmi/ui_add_command_request.cc @@ -36,12 +36,11 @@ namespace application_manager { namespace commands { -UIAddCommandRequest::UIAddCommandRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} +UIAddCommandRequest::UIAddCommandRequest( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -UIAddCommandRequest::~UIAddCommandRequest() { -} +UIAddCommandRequest::~UIAddCommandRequest() {} void UIAddCommandRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,4 +51,3 @@ void UIAddCommandRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/ui_add_command_response.cc b/src/components/application_manager/src/commands/hmi/ui_add_command_response.cc index 96a1a00c3d..a7eaabc91e 100644 --- a/src/components/application_manager/src/commands/hmi/ui_add_command_response.cc +++ b/src/components/application_manager/src/commands/hmi/ui_add_command_response.cc @@ -37,12 +37,11 @@ namespace application_manager { namespace commands { -UIAddCommandResponse::UIAddCommandResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} +UIAddCommandResponse::UIAddCommandResponse( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -UIAddCommandResponse::~UIAddCommandResponse() { -} +UIAddCommandResponse::~UIAddCommandResponse() {} void UIAddCommandResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/ui_add_submenu_request.cc b/src/components/application_manager/src/commands/hmi/ui_add_submenu_request.cc index cf080a8d04..f0a233853c 100644 --- a/src/components/application_manager/src/commands/hmi/ui_add_submenu_request.cc +++ b/src/components/application_manager/src/commands/hmi/ui_add_submenu_request.cc @@ -36,12 +36,11 @@ namespace application_manager { namespace commands { -UIAddSubmenuRequest::UIAddSubmenuRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} +UIAddSubmenuRequest::UIAddSubmenuRequest( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -UIAddSubmenuRequest::~UIAddSubmenuRequest() { -} +UIAddSubmenuRequest::~UIAddSubmenuRequest() {} void UIAddSubmenuRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,4 +51,3 @@ void UIAddSubmenuRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/ui_add_submenu_response.cc b/src/components/application_manager/src/commands/hmi/ui_add_submenu_response.cc index cd8d6c9b35..6c6c18cbad 100644 --- a/src/components/application_manager/src/commands/hmi/ui_add_submenu_response.cc +++ b/src/components/application_manager/src/commands/hmi/ui_add_submenu_response.cc @@ -38,12 +38,11 @@ namespace application_manager { namespace commands { -UIAddSubmenuResponse::UIAddSubmenuResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} +UIAddSubmenuResponse::UIAddSubmenuResponse( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -UIAddSubmenuResponse::~UIAddSubmenuResponse() { -} +UIAddSubmenuResponse::~UIAddSubmenuResponse() {} void UIAddSubmenuResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/ui_alert_request.cc b/src/components/application_manager/src/commands/hmi/ui_alert_request.cc index ae8e8d1e88..44673d4981 100644 --- a/src/components/application_manager/src/commands/hmi/ui_alert_request.cc +++ b/src/components/application_manager/src/commands/hmi/ui_alert_request.cc @@ -36,12 +36,11 @@ namespace application_manager { namespace commands { -UIAlertRequest::UIAlertRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} +UIAlertRequest::UIAlertRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -UIAlertRequest::~UIAlertRequest() { -} +UIAlertRequest::~UIAlertRequest() {} void UIAlertRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,4 +51,3 @@ void UIAlertRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/ui_alert_response.cc b/src/components/application_manager/src/commands/hmi/ui_alert_response.cc index 865535e879..6d552a1eb7 100644 --- a/src/components/application_manager/src/commands/hmi/ui_alert_response.cc +++ b/src/components/application_manager/src/commands/hmi/ui_alert_response.cc @@ -38,12 +38,11 @@ namespace application_manager { namespace commands { -UIAlertResponse::UIAlertResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} +UIAlertResponse::UIAlertResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -UIAlertResponse::~UIAlertResponse() { -} +UIAlertResponse::~UIAlertResponse() {} void UIAlertResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/ui_change_registration_request.cc b/src/components/application_manager/src/commands/hmi/ui_change_registration_request.cc index 87a9e4ba62..dcc88125fc 100644 --- a/src/components/application_manager/src/commands/hmi/ui_change_registration_request.cc +++ b/src/components/application_manager/src/commands/hmi/ui_change_registration_request.cc @@ -38,11 +38,9 @@ namespace commands { UIChangeRegistrationRequest::UIChangeRegistrationRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} + : RequestToHMI(message, application_manager) {} -UIChangeRegistrationRequest::~UIChangeRegistrationRequest() { -} +UIChangeRegistrationRequest::~UIChangeRegistrationRequest() {} void UIChangeRegistrationRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -53,4 +51,3 @@ void UIChangeRegistrationRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/ui_change_registration_response.cc b/src/components/application_manager/src/commands/hmi/ui_change_registration_response.cc index dea74fc2d7..52805a93c8 100644 --- a/src/components/application_manager/src/commands/hmi/ui_change_registration_response.cc +++ b/src/components/application_manager/src/commands/hmi/ui_change_registration_response.cc @@ -40,11 +40,9 @@ namespace commands { UIChangeRegistratioResponse::UIChangeRegistratioResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} + : ResponseFromHMI(message, application_manager) {} -UIChangeRegistratioResponse::~UIChangeRegistratioResponse() { -} +UIChangeRegistratioResponse::~UIChangeRegistratioResponse() {} void UIChangeRegistratioResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/ui_delete_command_request.cc b/src/components/application_manager/src/commands/hmi/ui_delete_command_request.cc index 711067abf8..7bd529e8dc 100644 --- a/src/components/application_manager/src/commands/hmi/ui_delete_command_request.cc +++ b/src/components/application_manager/src/commands/hmi/ui_delete_command_request.cc @@ -36,12 +36,11 @@ namespace application_manager { namespace commands { -UIDeleteCommandRequest::UIDeleteCommandRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} +UIDeleteCommandRequest::UIDeleteCommandRequest( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -UIDeleteCommandRequest::~UIDeleteCommandRequest() { -} +UIDeleteCommandRequest::~UIDeleteCommandRequest() {} void UIDeleteCommandRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,4 +51,3 @@ void UIDeleteCommandRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/ui_delete_command_response.cc b/src/components/application_manager/src/commands/hmi/ui_delete_command_response.cc index ac03d015f4..74a1bd64c2 100644 --- a/src/components/application_manager/src/commands/hmi/ui_delete_command_response.cc +++ b/src/components/application_manager/src/commands/hmi/ui_delete_command_response.cc @@ -40,11 +40,9 @@ namespace commands { UIDeleteCommandResponse::UIDeleteCommandResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} + : ResponseFromHMI(message, application_manager) {} -UIDeleteCommandResponse::~UIDeleteCommandResponse() { -} +UIDeleteCommandResponse::~UIDeleteCommandResponse() {} void UIDeleteCommandResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/ui_delete_submenu_request.cc b/src/components/application_manager/src/commands/hmi/ui_delete_submenu_request.cc index 9143186526..335d97eee4 100644 --- a/src/components/application_manager/src/commands/hmi/ui_delete_submenu_request.cc +++ b/src/components/application_manager/src/commands/hmi/ui_delete_submenu_request.cc @@ -36,12 +36,11 @@ namespace application_manager { namespace commands { -UIDeleteSubmenuRequest::UIDeleteSubmenuRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} +UIDeleteSubmenuRequest::UIDeleteSubmenuRequest( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -UIDeleteSubmenuRequest::~UIDeleteSubmenuRequest() { -} +UIDeleteSubmenuRequest::~UIDeleteSubmenuRequest() {} void UIDeleteSubmenuRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,4 +51,3 @@ void UIDeleteSubmenuRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/ui_delete_submenu_response.cc b/src/components/application_manager/src/commands/hmi/ui_delete_submenu_response.cc index 6926bddefa..302343da5e 100644 --- a/src/components/application_manager/src/commands/hmi/ui_delete_submenu_response.cc +++ b/src/components/application_manager/src/commands/hmi/ui_delete_submenu_response.cc @@ -40,11 +40,9 @@ namespace commands { UIDeleteSubmenuResponse::UIDeleteSubmenuResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} + : ResponseFromHMI(message, application_manager) {} -UIDeleteSubmenuResponse::~UIDeleteSubmenuResponse() { -} +UIDeleteSubmenuResponse::~UIDeleteSubmenuResponse() {} void UIDeleteSubmenuResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/ui_end_audio_pass_thru_request.cc b/src/components/application_manager/src/commands/hmi/ui_end_audio_pass_thru_request.cc index 7837cc1bca..e1cd11f922 100644 --- a/src/components/application_manager/src/commands/hmi/ui_end_audio_pass_thru_request.cc +++ b/src/components/application_manager/src/commands/hmi/ui_end_audio_pass_thru_request.cc @@ -38,11 +38,9 @@ namespace commands { UIEndAudioPassThruRequest::UIEndAudioPassThruRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} + : RequestToHMI(message, application_manager) {} -UIEndAudioPassThruRequest::~UIEndAudioPassThruRequest() { -} +UIEndAudioPassThruRequest::~UIEndAudioPassThruRequest() {} void UIEndAudioPassThruRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -53,4 +51,3 @@ void UIEndAudioPassThruRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/ui_end_audio_pass_thru_response.cc b/src/components/application_manager/src/commands/hmi/ui_end_audio_pass_thru_response.cc index 38d5c75cf8..e9eb596b85 100644 --- a/src/components/application_manager/src/commands/hmi/ui_end_audio_pass_thru_response.cc +++ b/src/components/application_manager/src/commands/hmi/ui_end_audio_pass_thru_response.cc @@ -40,11 +40,9 @@ namespace commands { UIEndAudioPassThruResponse::UIEndAudioPassThruResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} + : ResponseFromHMI(message, application_manager) {} -UIEndAudioPassThruResponse::~UIEndAudioPassThruResponse() { -} +UIEndAudioPassThruResponse::~UIEndAudioPassThruResponse() {} void UIEndAudioPassThruResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/ui_get_capabilities_request.cc b/src/components/application_manager/src/commands/hmi/ui_get_capabilities_request.cc index acbd8d277a..0ae4258d6b 100644 --- a/src/components/application_manager/src/commands/hmi/ui_get_capabilities_request.cc +++ b/src/components/application_manager/src/commands/hmi/ui_get_capabilities_request.cc @@ -38,11 +38,9 @@ namespace commands { UIGetCapabilitiesRequest::UIGetCapabilitiesRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} + : RequestToHMI(message, application_manager) {} -UIGetCapabilitiesRequest::~UIGetCapabilitiesRequest() { -} +UIGetCapabilitiesRequest::~UIGetCapabilitiesRequest() {} void UIGetCapabilitiesRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -53,4 +51,3 @@ void UIGetCapabilitiesRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc b/src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc index e0a07736f4..de0a2f2157 100644 --- a/src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc +++ b/src/components/application_manager/src/commands/hmi/ui_get_capabilities_response.cc @@ -31,24 +31,20 @@ */ #include "application_manager/commands/hmi/ui_get_capabilities_response.h" - namespace application_manager { namespace commands { UIGetCapabilitiesResponse::UIGetCapabilitiesResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} + : ResponseFromHMI(message, application_manager) {} -UIGetCapabilitiesResponse::~UIGetCapabilitiesResponse() { -} +UIGetCapabilitiesResponse::~UIGetCapabilitiesResponse() {} void UIGetCapabilitiesResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); - HMICapabilities& hmi_capabilities = - application_manager_.hmi_capabilities(); + HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities(); const smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params]; @@ -83,7 +79,6 @@ void UIGetCapabilitiesResponse::Run() { msg_params[strings::hmi_capabilities][strings::phone_call].asBool()); } } - } } // namespace commands diff --git a/src/components/application_manager/src/commands/hmi/ui_get_language_request.cc b/src/components/application_manager/src/commands/hmi/ui_get_language_request.cc index 698cdc84ab..59d9eef6e3 100644 --- a/src/components/application_manager/src/commands/hmi/ui_get_language_request.cc +++ b/src/components/application_manager/src/commands/hmi/ui_get_language_request.cc @@ -36,12 +36,11 @@ namespace application_manager { namespace commands { -UIGetLanguageRequest::UIGetLanguageRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} +UIGetLanguageRequest::UIGetLanguageRequest( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -UIGetLanguageRequest::~UIGetLanguageRequest() { -} +UIGetLanguageRequest::~UIGetLanguageRequest() {} void UIGetLanguageRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,4 +51,3 @@ void UIGetLanguageRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/ui_get_language_response.cc b/src/components/application_manager/src/commands/hmi/ui_get_language_response.cc index 02527a19d2..dfbdb89804 100644 --- a/src/components/application_manager/src/commands/hmi/ui_get_language_response.cc +++ b/src/components/application_manager/src/commands/hmi/ui_get_language_response.cc @@ -38,12 +38,11 @@ namespace application_manager { namespace commands { -UIGetLanguageResponse::UIGetLanguageResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} +UIGetLanguageResponse::UIGetLanguageResponse( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -UIGetLanguageResponse::~UIGetLanguageResponse() { -} +UIGetLanguageResponse::~UIGetLanguageResponse() {} void UIGetLanguageResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -53,17 +52,16 @@ void UIGetLanguageResponse::Run() { if ((*message_).keyExists(strings::msg_params) && (*message_)[strings::msg_params].keyExists(hmi_response::language)) { - language = static_cast<Common_Language::eType>( - (*message_)[strings::msg_params][hmi_response::language].asInt()); + (*message_)[strings::msg_params][hmi_response::language].asInt()); } - application_manager_.hmi_capabilities(). - set_active_ui_language(language); + application_manager_.hmi_capabilities().set_active_ui_language(language); - LOG4CXX_DEBUG(logger_, "Raising event for function_id " - << function_id() - << " and correlation_id " << correlation_id()); + LOG4CXX_DEBUG(logger_, + "Raising event for function_id " << function_id() + << " and correlation_id " + << correlation_id()); event_engine::Event event(FunctionID::UI_GetLanguage); event.set_smart_object(*message_); event.raise(application_manager_.event_dispatcher()); diff --git a/src/components/application_manager/src/commands/hmi/ui_get_supported_languages_request.cc b/src/components/application_manager/src/commands/hmi/ui_get_supported_languages_request.cc index 55959c5638..598ff39f79 100644 --- a/src/components/application_manager/src/commands/hmi/ui_get_supported_languages_request.cc +++ b/src/components/application_manager/src/commands/hmi/ui_get_supported_languages_request.cc @@ -38,11 +38,9 @@ namespace commands { UIGetSupportedLanguagesRequest::UIGetSupportedLanguagesRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} + : RequestToHMI(message, application_manager) {} -UIGetSupportedLanguagesRequest::~UIGetSupportedLanguagesRequest() { -} +UIGetSupportedLanguagesRequest::~UIGetSupportedLanguagesRequest() {} void UIGetSupportedLanguagesRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -53,4 +51,3 @@ void UIGetSupportedLanguagesRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/ui_get_supported_languages_response.cc b/src/components/application_manager/src/commands/hmi/ui_get_supported_languages_response.cc index d7b0d6b359..e5849f5f63 100644 --- a/src/components/application_manager/src/commands/hmi/ui_get_supported_languages_response.cc +++ b/src/components/application_manager/src/commands/hmi/ui_get_supported_languages_response.cc @@ -39,11 +39,9 @@ namespace commands { UIGetSupportedLanguagesResponse::UIGetSupportedLanguagesResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} + : ResponseFromHMI(message, application_manager) {} -UIGetSupportedLanguagesResponse::~UIGetSupportedLanguagesResponse() { -} +UIGetSupportedLanguagesResponse::~UIGetSupportedLanguagesResponse() {} void UIGetSupportedLanguagesResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -53,8 +51,7 @@ void UIGetSupportedLanguagesResponse::Run() { (*message_)[strings::params][hmi_response::code].asInt()); if (hmi_apis::Common_Result::SUCCESS == code) { - HMICapabilities& hmi_capabilities = - application_manager_.hmi_capabilities(); + HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities(); hmi_capabilities.set_ui_supported_languages( (*message_)[strings::msg_params][hmi_response::languages]); diff --git a/src/components/application_manager/src/commands/hmi/ui_is_ready_request.cc b/src/components/application_manager/src/commands/hmi/ui_is_ready_request.cc index efe4ddcd2a..463ae9d41d 100644 --- a/src/components/application_manager/src/commands/hmi/ui_is_ready_request.cc +++ b/src/components/application_manager/src/commands/hmi/ui_is_ready_request.cc @@ -36,12 +36,11 @@ namespace application_manager { namespace commands { -UIIsReadyRequest::UIIsReadyRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} +UIIsReadyRequest::UIIsReadyRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -UIIsReadyRequest::~UIIsReadyRequest() { -} +UIIsReadyRequest::~UIIsReadyRequest() {} void UIIsReadyRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,4 +51,3 @@ void UIIsReadyRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/ui_is_ready_response.cc b/src/components/application_manager/src/commands/hmi/ui_is_ready_response.cc index 98ff58c752..e7fca943bc 100644 --- a/src/components/application_manager/src/commands/hmi/ui_is_ready_response.cc +++ b/src/components/application_manager/src/commands/hmi/ui_is_ready_response.cc @@ -31,17 +31,15 @@ */ #include "application_manager/commands/hmi/ui_is_ready_response.h" - namespace application_manager { namespace commands { -UIIsReadyResponse::UIIsReadyResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} +UIIsReadyResponse::UIIsReadyResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -UIIsReadyResponse::~UIIsReadyResponse() { -} +UIIsReadyResponse::~UIIsReadyResponse() {} void UIIsReadyResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,8 +50,7 @@ void UIIsReadyResponse::Run() { is_available = object[strings::msg_params][strings::available].asBool(); } - HMICapabilities& hmi_capabilities = - application_manager_.hmi_capabilities(); + HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities(); hmi_capabilities.set_is_ui_cooperating(is_available); } diff --git a/src/components/application_manager/src/commands/hmi/ui_perform_audio_pass_thru_request.cc b/src/components/application_manager/src/commands/hmi/ui_perform_audio_pass_thru_request.cc index 52a39e1ecc..a88719d303 100644 --- a/src/components/application_manager/src/commands/hmi/ui_perform_audio_pass_thru_request.cc +++ b/src/components/application_manager/src/commands/hmi/ui_perform_audio_pass_thru_request.cc @@ -38,11 +38,9 @@ namespace commands { UIPerformAudioPassThruRequest::UIPerformAudioPassThruRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} + : RequestToHMI(message, application_manager) {} -UIPerformAudioPassThruRequest::~UIPerformAudioPassThruRequest() { -} +UIPerformAudioPassThruRequest::~UIPerformAudioPassThruRequest() {} void UIPerformAudioPassThruRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -53,4 +51,3 @@ void UIPerformAudioPassThruRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/ui_perform_audio_pass_thru_response.cc b/src/components/application_manager/src/commands/hmi/ui_perform_audio_pass_thru_response.cc index 47299698ab..0736cca526 100644 --- a/src/components/application_manager/src/commands/hmi/ui_perform_audio_pass_thru_response.cc +++ b/src/components/application_manager/src/commands/hmi/ui_perform_audio_pass_thru_response.cc @@ -39,11 +39,9 @@ namespace commands { UIPerformAudioPassThruResponse::UIPerformAudioPassThruResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} + : ResponseFromHMI(message, application_manager) {} -UIPerformAudioPassThruResponse::~UIPerformAudioPassThruResponse() { -} +UIPerformAudioPassThruResponse::~UIPerformAudioPassThruResponse() {} void UIPerformAudioPassThruResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/ui_perform_interaction_request.cc b/src/components/application_manager/src/commands/hmi/ui_perform_interaction_request.cc index 9199ad23e8..82a900f1ae 100644 --- a/src/components/application_manager/src/commands/hmi/ui_perform_interaction_request.cc +++ b/src/components/application_manager/src/commands/hmi/ui_perform_interaction_request.cc @@ -38,11 +38,9 @@ namespace commands { UIPerformInteractionRequest::UIPerformInteractionRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} + : RequestToHMI(message, application_manager) {} -UIPerformInteractionRequest::~UIPerformInteractionRequest() { -} +UIPerformInteractionRequest::~UIPerformInteractionRequest() {} void UIPerformInteractionRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -53,4 +51,3 @@ void UIPerformInteractionRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/ui_perform_interaction_response.cc b/src/components/application_manager/src/commands/hmi/ui_perform_interaction_response.cc index 0d264ee3af..ea78c0cd66 100644 --- a/src/components/application_manager/src/commands/hmi/ui_perform_interaction_response.cc +++ b/src/components/application_manager/src/commands/hmi/ui_perform_interaction_response.cc @@ -39,11 +39,9 @@ namespace commands { UIPerformInteractionResponse::UIPerformInteractionResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} + : ResponseFromHMI(message, application_manager) {} -UIPerformInteractionResponse::~UIPerformInteractionResponse() { -} +UIPerformInteractionResponse::~UIPerformInteractionResponse() {} void UIPerformInteractionResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/ui_scrollable_message_request.cc b/src/components/application_manager/src/commands/hmi/ui_scrollable_message_request.cc index 3f08393d39..006944d404 100644 --- a/src/components/application_manager/src/commands/hmi/ui_scrollable_message_request.cc +++ b/src/components/application_manager/src/commands/hmi/ui_scrollable_message_request.cc @@ -38,11 +38,9 @@ namespace commands { UIScrollableMessageRequest::UIScrollableMessageRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} + : RequestToHMI(message, application_manager) {} -UIScrollableMessageRequest::~UIScrollableMessageRequest() { -} +UIScrollableMessageRequest::~UIScrollableMessageRequest() {} void UIScrollableMessageRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -53,4 +51,3 @@ void UIScrollableMessageRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/ui_scrollable_message_response.cc b/src/components/application_manager/src/commands/hmi/ui_scrollable_message_response.cc index 129872dec4..c39a99fc61 100644 --- a/src/components/application_manager/src/commands/hmi/ui_scrollable_message_response.cc +++ b/src/components/application_manager/src/commands/hmi/ui_scrollable_message_response.cc @@ -39,11 +39,9 @@ namespace commands { UIScrollableMessageResponse::UIScrollableMessageResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} + : ResponseFromHMI(message, application_manager) {} -UIScrollableMessageResponse::~UIScrollableMessageResponse() { -} +UIScrollableMessageResponse::~UIScrollableMessageResponse() {} void UIScrollableMessageResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/ui_set_app_icon_request.cc b/src/components/application_manager/src/commands/hmi/ui_set_app_icon_request.cc index 585a2f4101..2666eedfc8 100644 --- a/src/components/application_manager/src/commands/hmi/ui_set_app_icon_request.cc +++ b/src/components/application_manager/src/commands/hmi/ui_set_app_icon_request.cc @@ -36,12 +36,11 @@ namespace application_manager { namespace commands { -UISetAppIconRequest::UISetAppIconRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} +UISetAppIconRequest::UISetAppIconRequest( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -UISetAppIconRequest::~UISetAppIconRequest() { -} +UISetAppIconRequest::~UISetAppIconRequest() {} void UISetAppIconRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,4 +51,3 @@ void UISetAppIconRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/ui_set_app_icon_response.cc b/src/components/application_manager/src/commands/hmi/ui_set_app_icon_response.cc index e518b5651b..18fc5a5761 100644 --- a/src/components/application_manager/src/commands/hmi/ui_set_app_icon_response.cc +++ b/src/components/application_manager/src/commands/hmi/ui_set_app_icon_response.cc @@ -37,12 +37,11 @@ namespace application_manager { namespace commands { -UISetAppIconResponse::UISetAppIconResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} +UISetAppIconResponse::UISetAppIconResponse( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -UISetAppIconResponse::~UISetAppIconResponse() { -} +UISetAppIconResponse::~UISetAppIconResponse() {} void UISetAppIconResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/ui_set_display_layout_request.cc b/src/components/application_manager/src/commands/hmi/ui_set_display_layout_request.cc index 46df71803c..cd69c9c8e6 100644 --- a/src/components/application_manager/src/commands/hmi/ui_set_display_layout_request.cc +++ b/src/components/application_manager/src/commands/hmi/ui_set_display_layout_request.cc @@ -37,11 +37,10 @@ namespace application_manager { namespace commands { UiSetDisplayLayoutRequest::UiSetDisplayLayoutRequest( - const MessageSharedPtr& message, ApplicationManager& application_manager): RequestToHMI(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -UiSetDisplayLayoutRequest::~UiSetDisplayLayoutRequest() { -} +UiSetDisplayLayoutRequest::~UiSetDisplayLayoutRequest() {} void UiSetDisplayLayoutRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -51,4 +50,3 @@ void UiSetDisplayLayoutRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/ui_set_display_layout_response.cc b/src/components/application_manager/src/commands/hmi/ui_set_display_layout_response.cc index 46cea52160..c5a439636f 100644 --- a/src/components/application_manager/src/commands/hmi/ui_set_display_layout_response.cc +++ b/src/components/application_manager/src/commands/hmi/ui_set_display_layout_response.cc @@ -39,11 +39,10 @@ namespace application_manager { namespace commands { UiSetDisplayLayoutResponse::UiSetDisplayLayoutResponse( - const MessageSharedPtr& message, ApplicationManager& application_manager): ResponseFromHMI(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -UiSetDisplayLayoutResponse::~UiSetDisplayLayoutResponse() { -} +UiSetDisplayLayoutResponse::~UiSetDisplayLayoutResponse() {} void UiSetDisplayLayoutResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/ui_set_global_properties_request.cc b/src/components/application_manager/src/commands/hmi/ui_set_global_properties_request.cc index 6e26c74c26..8658a043b0 100644 --- a/src/components/application_manager/src/commands/hmi/ui_set_global_properties_request.cc +++ b/src/components/application_manager/src/commands/hmi/ui_set_global_properties_request.cc @@ -38,11 +38,9 @@ namespace commands { UISetGlobalPropertiesRequest::UISetGlobalPropertiesRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} + : RequestToHMI(message, application_manager) {} -UISetGlobalPropertiesRequest::~UISetGlobalPropertiesRequest() { -} +UISetGlobalPropertiesRequest::~UISetGlobalPropertiesRequest() {} void UISetGlobalPropertiesRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -53,4 +51,3 @@ void UISetGlobalPropertiesRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/ui_set_global_properties_response.cc b/src/components/application_manager/src/commands/hmi/ui_set_global_properties_response.cc index 9dc6659e8f..d10c206a7c 100644 --- a/src/components/application_manager/src/commands/hmi/ui_set_global_properties_response.cc +++ b/src/components/application_manager/src/commands/hmi/ui_set_global_properties_response.cc @@ -39,11 +39,9 @@ namespace commands { UISetGlobalPropertiesResponse::UISetGlobalPropertiesResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} + : ResponseFromHMI(message, application_manager) {} -UISetGlobalPropertiesResponse::~UISetGlobalPropertiesResponse() { -} +UISetGlobalPropertiesResponse::~UISetGlobalPropertiesResponse() {} void UISetGlobalPropertiesResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/ui_set_media_clock_timer_request.cc b/src/components/application_manager/src/commands/hmi/ui_set_media_clock_timer_request.cc index 0f2c66e7e1..955cb1d57b 100644 --- a/src/components/application_manager/src/commands/hmi/ui_set_media_clock_timer_request.cc +++ b/src/components/application_manager/src/commands/hmi/ui_set_media_clock_timer_request.cc @@ -38,11 +38,9 @@ namespace commands { UISetMediaClockTimerRequest::UISetMediaClockTimerRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} + : RequestToHMI(message, application_manager) {} -UISetMediaClockTimerRequest::~UISetMediaClockTimerRequest() { -} +UISetMediaClockTimerRequest::~UISetMediaClockTimerRequest() {} void UISetMediaClockTimerRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -53,4 +51,3 @@ void UISetMediaClockTimerRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/ui_set_media_clock_timer_response.cc b/src/components/application_manager/src/commands/hmi/ui_set_media_clock_timer_response.cc index 66b4168ee5..32acef4994 100644 --- a/src/components/application_manager/src/commands/hmi/ui_set_media_clock_timer_response.cc +++ b/src/components/application_manager/src/commands/hmi/ui_set_media_clock_timer_response.cc @@ -39,11 +39,9 @@ namespace commands { UISetMediaClockTimerResponse::UISetMediaClockTimerResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} + : ResponseFromHMI(message, application_manager) {} -UISetMediaClockTimerResponse::~UISetMediaClockTimerResponse() { -} +UISetMediaClockTimerResponse::~UISetMediaClockTimerResponse() {} void UISetMediaClockTimerResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/ui_show_request.cc b/src/components/application_manager/src/commands/hmi/ui_show_request.cc index 3d9310f5e3..9c0e90feff 100644 --- a/src/components/application_manager/src/commands/hmi/ui_show_request.cc +++ b/src/components/application_manager/src/commands/hmi/ui_show_request.cc @@ -36,12 +36,11 @@ namespace application_manager { namespace commands { -UIShowRequest::UIShowRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} +UIShowRequest::UIShowRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -UIShowRequest::~UIShowRequest() { -} +UIShowRequest::~UIShowRequest() {} void UIShowRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,4 +51,3 @@ void UIShowRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/ui_show_response.cc b/src/components/application_manager/src/commands/hmi/ui_show_response.cc index 644412c0ec..333d9e96c5 100644 --- a/src/components/application_manager/src/commands/hmi/ui_show_response.cc +++ b/src/components/application_manager/src/commands/hmi/ui_show_response.cc @@ -36,12 +36,11 @@ namespace application_manager { namespace commands { -UIShowResponse::UIShowResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} +UIShowResponse::UIShowResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -UIShowResponse::~UIShowResponse() { -} +UIShowResponse::~UIShowResponse() {} void UIShowResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/ui_slider_request.cc b/src/components/application_manager/src/commands/hmi/ui_slider_request.cc index 2a8c383bc4..26e6ed76b0 100644 --- a/src/components/application_manager/src/commands/hmi/ui_slider_request.cc +++ b/src/components/application_manager/src/commands/hmi/ui_slider_request.cc @@ -36,12 +36,11 @@ namespace application_manager { namespace commands { -UISliderRequest::UISliderRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} +UISliderRequest::UISliderRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -UISliderRequest::~UISliderRequest() { -} +UISliderRequest::~UISliderRequest() {} void UISliderRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,4 +51,3 @@ void UISliderRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/ui_slider_response.cc b/src/components/application_manager/src/commands/hmi/ui_slider_response.cc index 1a036015b3..091eb50e0d 100644 --- a/src/components/application_manager/src/commands/hmi/ui_slider_response.cc +++ b/src/components/application_manager/src/commands/hmi/ui_slider_response.cc @@ -37,12 +37,11 @@ namespace application_manager { namespace commands { -UISliderResponse::UISliderResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} +UISliderResponse::UISliderResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -UISliderResponse::~UISliderResponse() { -} +UISliderResponse::~UISliderResponse() {} void UISliderResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/update_app_list_request.cc b/src/components/application_manager/src/commands/hmi/update_app_list_request.cc index ccd0858e72..286d269727 100644 --- a/src/components/application_manager/src/commands/hmi/update_app_list_request.cc +++ b/src/components/application_manager/src/commands/hmi/update_app_list_request.cc @@ -36,12 +36,11 @@ namespace application_manager { namespace commands { -UpdateAppListRequest::UpdateAppListRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} +UpdateAppListRequest::UpdateAppListRequest( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -UpdateAppListRequest::~UpdateAppListRequest() { -} +UpdateAppListRequest::~UpdateAppListRequest() {} void UpdateAppListRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,5 +51,3 @@ void UpdateAppListRequest::Run() { } // namespace commands } // namespace application_manager - - diff --git a/src/components/application_manager/src/commands/hmi/update_app_list_response.cc b/src/components/application_manager/src/commands/hmi/update_app_list_response.cc index f8a1fe5489..6546d03805 100644 --- a/src/components/application_manager/src/commands/hmi/update_app_list_response.cc +++ b/src/components/application_manager/src/commands/hmi/update_app_list_response.cc @@ -36,12 +36,11 @@ namespace application_manager { namespace commands { -UpdateAppListResponse::UpdateAppListResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} +UpdateAppListResponse::UpdateAppListResponse( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -UpdateAppListResponse::~UpdateAppListResponse() { -} +UpdateAppListResponse::~UpdateAppListResponse() {} void UpdateAppListResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,5 +51,3 @@ void UpdateAppListResponse::Run() { } // namespace commands } // namespace application_manager - - diff --git a/src/components/application_manager/src/commands/hmi/update_device_list_request.cc b/src/components/application_manager/src/commands/hmi/update_device_list_request.cc index 93da0b9eb8..74d104b36d 100644 --- a/src/components/application_manager/src/commands/hmi/update_device_list_request.cc +++ b/src/components/application_manager/src/commands/hmi/update_device_list_request.cc @@ -32,7 +32,6 @@ #include "application_manager/commands/hmi/update_device_list_request.h" - #include "interfaces/HMI_API.h" #include <unistd.h> @@ -46,14 +45,14 @@ UpdateDeviceListRequest::UpdateDeviceListRequest( : RequestToHMI(message, application_manager) , EventObserver(application_manager_.event_dispatcher()) {} -UpdateDeviceListRequest::~UpdateDeviceListRequest() { -} +UpdateDeviceListRequest::~UpdateDeviceListRequest() {} void UpdateDeviceListRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); sync_primitives::AutoLock auto_lock(wait_hmi_lock); // Fix problem with SDL and HMI HTML. This problem is not actual for HMI PASA. - // Flag conditional compilation for specific customer is used in order to exclude + // Flag conditional compilation for specific customer is used in order to + // exclude // hit code to RTC if (true == application_manager_.get_settings().launch_hmi()) { if (!application_manager_.IsHMICooperating()) { @@ -71,13 +70,13 @@ void UpdateDeviceListRequest::on_event(const event_engine::Event& event) { LOG4CXX_AUTO_TRACE(logger_); sync_primitives::AutoLock auto_lock(wait_hmi_lock); switch (event.id()) { - case hmi_apis::FunctionID::BasicCommunication_OnReady : { + case hmi_apis::FunctionID::BasicCommunication_OnReady: { LOG4CXX_INFO(logger_, "received OnReady"); unsubscribe_from_event(hmi_apis::FunctionID::BasicCommunication_OnReady); termination_condition_.Broadcast(); break; }; - default : { + default: { LOG4CXX_ERROR(logger_, "Unknown event "); break; }; @@ -93,4 +92,3 @@ bool UpdateDeviceListRequest::CleanUp() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/update_device_list_response.cc b/src/components/application_manager/src/commands/hmi/update_device_list_response.cc index 1a53231a3b..6d9dec92f8 100644 --- a/src/components/application_manager/src/commands/hmi/update_device_list_response.cc +++ b/src/components/application_manager/src/commands/hmi/update_device_list_response.cc @@ -37,11 +37,9 @@ namespace commands { UpdateDeviceListResponse::UpdateDeviceListResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} + : ResponseFromHMI(message, application_manager) {} -UpdateDeviceListResponse::~UpdateDeviceListResponse() { -} +UpdateDeviceListResponse::~UpdateDeviceListResponse() {} void UpdateDeviceListResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/update_sdl_request.cc b/src/components/application_manager/src/commands/hmi/update_sdl_request.cc index c476de2665..44f7547964 100644 --- a/src/components/application_manager/src/commands/hmi/update_sdl_request.cc +++ b/src/components/application_manager/src/commands/hmi/update_sdl_request.cc @@ -37,12 +37,11 @@ namespace application_manager { namespace commands { -UpdateSDLRequest::UpdateSDLRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} +UpdateSDLRequest::UpdateSDLRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -UpdateSDLRequest::~UpdateSDLRequest() { -} +UpdateSDLRequest::~UpdateSDLRequest() {} void UpdateSDLRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -54,4 +53,3 @@ void UpdateSDLRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/update_sdl_response.cc b/src/components/application_manager/src/commands/hmi/update_sdl_response.cc index aa5dc32881..0e8978fe89 100644 --- a/src/components/application_manager/src/commands/hmi/update_sdl_response.cc +++ b/src/components/application_manager/src/commands/hmi/update_sdl_response.cc @@ -31,17 +31,15 @@ */ #include "application_manager/commands/hmi/update_sdl_response.h" - namespace application_manager { namespace commands { -UpdateSDLResponse::UpdateSDLResponse( - const MessageSharedPtr& message, ApplicationManager& application_manager): ResponseFromHMI(message, application_manager) { -} +UpdateSDLResponse::UpdateSDLResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -UpdateSDLResponse::~UpdateSDLResponse() { -} +UpdateSDLResponse::~UpdateSDLResponse() {} void UpdateSDLResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/vi_diagnostic_message_request.cc b/src/components/application_manager/src/commands/hmi/vi_diagnostic_message_request.cc index 0a06b37817..5fe81fcbd8 100644 --- a/src/components/application_manager/src/commands/hmi/vi_diagnostic_message_request.cc +++ b/src/components/application_manager/src/commands/hmi/vi_diagnostic_message_request.cc @@ -36,12 +36,11 @@ namespace application_manager { namespace commands { -VIDiagnosticMessageRequest::VIDiagnosticMessageRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} +VIDiagnosticMessageRequest::VIDiagnosticMessageRequest( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -VIDiagnosticMessageRequest::~VIDiagnosticMessageRequest() { -} +VIDiagnosticMessageRequest::~VIDiagnosticMessageRequest() {} void VIDiagnosticMessageRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,4 +51,3 @@ void VIDiagnosticMessageRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/vi_diagnostic_message_response.cc b/src/components/application_manager/src/commands/hmi/vi_diagnostic_message_response.cc index fa3ddbeea0..e19af75b54 100644 --- a/src/components/application_manager/src/commands/hmi/vi_diagnostic_message_response.cc +++ b/src/components/application_manager/src/commands/hmi/vi_diagnostic_message_response.cc @@ -37,17 +37,17 @@ namespace application_manager { namespace commands { -VIDiagnosticMessageResponse::VIDiagnosticMessageResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} +VIDiagnosticMessageResponse::VIDiagnosticMessageResponse( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -VIDiagnosticMessageResponse::~VIDiagnosticMessageResponse() { -} +VIDiagnosticMessageResponse::~VIDiagnosticMessageResponse() {} void VIDiagnosticMessageResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); - event_engine::Event event(hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage); + event_engine::Event event( + hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage); event.set_smart_object(*message_); event.raise(application_manager_.event_dispatcher()); } diff --git a/src/components/application_manager/src/commands/hmi/vi_get_dtcs_request.cc b/src/components/application_manager/src/commands/hmi/vi_get_dtcs_request.cc index 3584a8a43b..b373471c43 100644 --- a/src/components/application_manager/src/commands/hmi/vi_get_dtcs_request.cc +++ b/src/components/application_manager/src/commands/hmi/vi_get_dtcs_request.cc @@ -36,12 +36,11 @@ namespace application_manager { namespace commands { -VIGetDTCsRequest::VIGetDTCsRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} +VIGetDTCsRequest::VIGetDTCsRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -VIGetDTCsRequest::~VIGetDTCsRequest() { -} +VIGetDTCsRequest::~VIGetDTCsRequest() {} void VIGetDTCsRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,4 +51,3 @@ void VIGetDTCsRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/vi_get_dtcs_response.cc b/src/components/application_manager/src/commands/hmi/vi_get_dtcs_response.cc index e17c97ddd5..3e720f9dbc 100644 --- a/src/components/application_manager/src/commands/hmi/vi_get_dtcs_response.cc +++ b/src/components/application_manager/src/commands/hmi/vi_get_dtcs_response.cc @@ -37,12 +37,11 @@ namespace application_manager { namespace commands { -VIGetDTCsResponse::VIGetDTCsResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} +VIGetDTCsResponse::VIGetDTCsResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -VIGetDTCsResponse::~VIGetDTCsResponse() { -} +VIGetDTCsResponse::~VIGetDTCsResponse() {} void VIGetDTCsResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/vi_get_vehicle_data_request.cc b/src/components/application_manager/src/commands/hmi/vi_get_vehicle_data_request.cc index f4a6bb45b7..05424c4967 100644 --- a/src/components/application_manager/src/commands/hmi/vi_get_vehicle_data_request.cc +++ b/src/components/application_manager/src/commands/hmi/vi_get_vehicle_data_request.cc @@ -38,11 +38,9 @@ namespace commands { VIGetVehicleDataRequest::VIGetVehicleDataRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} + : RequestToHMI(message, application_manager) {} -VIGetVehicleDataRequest::~VIGetVehicleDataRequest() { -} +VIGetVehicleDataRequest::~VIGetVehicleDataRequest() {} void VIGetVehicleDataRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -53,4 +51,3 @@ void VIGetVehicleDataRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/vi_get_vehicle_data_response.cc b/src/components/application_manager/src/commands/hmi/vi_get_vehicle_data_response.cc index b826b90753..2794f6eddd 100644 --- a/src/components/application_manager/src/commands/hmi/vi_get_vehicle_data_response.cc +++ b/src/components/application_manager/src/commands/hmi/vi_get_vehicle_data_response.cc @@ -38,19 +38,17 @@ namespace commands { VIGetVehicleDataResponse::VIGetVehicleDataResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} + : ResponseFromHMI(message, application_manager) {} -VIGetVehicleDataResponse::~VIGetVehicleDataResponse() { -} +VIGetVehicleDataResponse::~VIGetVehicleDataResponse() {} void VIGetVehicleDataResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); event_engine::Event event(hmi_apis::FunctionID::VehicleInfo_GetVehicleData); - if ((*message_)[strings::params][strings::message_type] - == static_cast<int32_t>(hmi_apis::messageType::error_response)) { + if ((*message_)[strings::params][strings::message_type] == + static_cast<int32_t>(hmi_apis::messageType::error_response)) { smart_objects::SmartObject result(smart_objects::SmartType_Map); if ((*message_)[strings::params].keyExists(strings::data)) { diff --git a/src/components/application_manager/src/commands/hmi/vi_get_vehicle_type_request.cc b/src/components/application_manager/src/commands/hmi/vi_get_vehicle_type_request.cc index 465528f402..64a3831e1c 100644 --- a/src/components/application_manager/src/commands/hmi/vi_get_vehicle_type_request.cc +++ b/src/components/application_manager/src/commands/hmi/vi_get_vehicle_type_request.cc @@ -38,11 +38,9 @@ namespace commands { VIGetVehicleTypeRequest::VIGetVehicleTypeRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} + : RequestToHMI(message, application_manager) {} -VIGetVehicleTypeRequest::~VIGetVehicleTypeRequest() { -} +VIGetVehicleTypeRequest::~VIGetVehicleTypeRequest() {} void VIGetVehicleTypeRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -53,4 +51,3 @@ void VIGetVehicleTypeRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/vi_get_vehicle_type_response.cc b/src/components/application_manager/src/commands/hmi/vi_get_vehicle_type_response.cc index edc74b503c..2369eb7eee 100644 --- a/src/components/application_manager/src/commands/hmi/vi_get_vehicle_type_response.cc +++ b/src/components/application_manager/src/commands/hmi/vi_get_vehicle_type_response.cc @@ -31,24 +31,20 @@ */ #include "application_manager/commands/hmi/vi_get_vehicle_type_response.h" - namespace application_manager { namespace commands { VIGetVehicleTypeResponse::VIGetVehicleTypeResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} + : ResponseFromHMI(message, application_manager) {} -VIGetVehicleTypeResponse::~VIGetVehicleTypeResponse() { -} +VIGetVehicleTypeResponse::~VIGetVehicleTypeResponse() {} void VIGetVehicleTypeResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); - HMICapabilities& hmi_capabilities = - application_manager_.hmi_capabilities(); + HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities(); hmi_capabilities.set_vehicle_type( (*message_)[strings::msg_params][hmi_response::vehicle_type]); diff --git a/src/components/application_manager/src/commands/hmi/vi_is_ready_request.cc b/src/components/application_manager/src/commands/hmi/vi_is_ready_request.cc index 3c75072f85..3ecc2ffe90 100644 --- a/src/components/application_manager/src/commands/hmi/vi_is_ready_request.cc +++ b/src/components/application_manager/src/commands/hmi/vi_is_ready_request.cc @@ -36,12 +36,11 @@ namespace application_manager { namespace commands { -VIIsReadyRequest::VIIsReadyRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} +VIIsReadyRequest::VIIsReadyRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -VIIsReadyRequest::~VIIsReadyRequest() { -} +VIIsReadyRequest::~VIIsReadyRequest() {} void VIIsReadyRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,4 +51,3 @@ void VIIsReadyRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/vi_is_ready_response.cc b/src/components/application_manager/src/commands/hmi/vi_is_ready_response.cc index d4da852b73..91dae226b6 100644 --- a/src/components/application_manager/src/commands/hmi/vi_is_ready_response.cc +++ b/src/components/application_manager/src/commands/hmi/vi_is_ready_response.cc @@ -35,12 +35,11 @@ namespace application_manager { namespace commands { -VIIsReadyResponse::VIIsReadyResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} +VIIsReadyResponse::VIIsReadyResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -VIIsReadyResponse::~VIIsReadyResponse() { -} +VIIsReadyResponse::~VIIsReadyResponse() {} void VIIsReadyResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -51,8 +50,7 @@ void VIIsReadyResponse::Run() { is_available = object[strings::msg_params][strings::available].asBool(); } - HMICapabilities& hmi_capabilities = - application_manager_.hmi_capabilities(); + HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities(); hmi_capabilities.set_is_ivi_cooperating(is_available); application_manager_.GetPolicyHandler().OnVIIsReady(); diff --git a/src/components/application_manager/src/commands/hmi/vi_read_did_request.cc b/src/components/application_manager/src/commands/hmi/vi_read_did_request.cc index 2399182cb6..d72fcb8157 100644 --- a/src/components/application_manager/src/commands/hmi/vi_read_did_request.cc +++ b/src/components/application_manager/src/commands/hmi/vi_read_did_request.cc @@ -36,12 +36,11 @@ namespace application_manager { namespace commands { -VIReadDIDRequest::VIReadDIDRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} +VIReadDIDRequest::VIReadDIDRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -VIReadDIDRequest::~VIReadDIDRequest() { -} +VIReadDIDRequest::~VIReadDIDRequest() {} void VIReadDIDRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,4 +51,3 @@ void VIReadDIDRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/vi_read_did_response.cc b/src/components/application_manager/src/commands/hmi/vi_read_did_response.cc index d41df3caa7..568a573f88 100644 --- a/src/components/application_manager/src/commands/hmi/vi_read_did_response.cc +++ b/src/components/application_manager/src/commands/hmi/vi_read_did_response.cc @@ -32,18 +32,15 @@ #include "application_manager/commands/hmi/vi_read_did_response.h" #include "application_manager/event_engine/event.h" - - namespace application_manager { namespace commands { -VIReadDIDResponse::VIReadDIDResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} +VIReadDIDResponse::VIReadDIDResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -VIReadDIDResponse::~VIReadDIDResponse() { -} +VIReadDIDResponse::~VIReadDIDResponse() {} void VIReadDIDResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/vi_subscribe_vehicle_data_request.cc b/src/components/application_manager/src/commands/hmi/vi_subscribe_vehicle_data_request.cc index 85b7d7d9dc..5c953334bb 100644 --- a/src/components/application_manager/src/commands/hmi/vi_subscribe_vehicle_data_request.cc +++ b/src/components/application_manager/src/commands/hmi/vi_subscribe_vehicle_data_request.cc @@ -38,11 +38,9 @@ namespace commands { VISubscribeVehicleDataRequest::VISubscribeVehicleDataRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} + : RequestToHMI(message, application_manager) {} -VISubscribeVehicleDataRequest::~VISubscribeVehicleDataRequest() { -} +VISubscribeVehicleDataRequest::~VISubscribeVehicleDataRequest() {} void VISubscribeVehicleDataRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -53,4 +51,3 @@ void VISubscribeVehicleDataRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/vi_subscribe_vehicle_data_response.cc b/src/components/application_manager/src/commands/hmi/vi_subscribe_vehicle_data_response.cc index 97a37d9bfd..4df2d9190a 100644 --- a/src/components/application_manager/src/commands/hmi/vi_subscribe_vehicle_data_response.cc +++ b/src/components/application_manager/src/commands/hmi/vi_subscribe_vehicle_data_response.cc @@ -38,17 +38,14 @@ namespace commands { VISubscribeVehicleDataResponse::VISubscribeVehicleDataResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} + : ResponseFromHMI(message, application_manager) {} -VISubscribeVehicleDataResponse::~VISubscribeVehicleDataResponse() { -} +VISubscribeVehicleDataResponse::~VISubscribeVehicleDataResponse() {} void VISubscribeVehicleDataResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); event_engine::Event event( - hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData - ); + hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData); event.set_smart_object(*message_); event.raise(application_manager_.event_dispatcher()); } diff --git a/src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc b/src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc index 073e767a5c..2211cde19c 100644 --- a/src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc +++ b/src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_request.cc @@ -38,11 +38,9 @@ namespace commands { VIUnsubscribeVehicleDataRequest::VIUnsubscribeVehicleDataRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} + : RequestToHMI(message, application_manager) {} -VIUnsubscribeVehicleDataRequest::~VIUnsubscribeVehicleDataRequest() { -} +VIUnsubscribeVehicleDataRequest::~VIUnsubscribeVehicleDataRequest() {} void VIUnsubscribeVehicleDataRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -53,4 +51,3 @@ void VIUnsubscribeVehicleDataRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc b/src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc index 15df29d5e7..5044f0ef43 100644 --- a/src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc +++ b/src/components/application_manager/src/commands/hmi/vi_unsubscribe_vehicle_data_response.cc @@ -38,17 +38,14 @@ namespace commands { VIUnsubscribeVehicleDataResponse::VIUnsubscribeVehicleDataResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} + : ResponseFromHMI(message, application_manager) {} -VIUnsubscribeVehicleDataResponse::~VIUnsubscribeVehicleDataResponse() { -} +VIUnsubscribeVehicleDataResponse::~VIUnsubscribeVehicleDataResponse() {} void VIUnsubscribeVehicleDataResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); event_engine::Event event( - hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData - ); + hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData); event.set_smart_object(*message_); event.raise(application_manager_.event_dispatcher()); } diff --git a/src/components/application_manager/src/commands/hmi/vr_add_command_request.cc b/src/components/application_manager/src/commands/hmi/vr_add_command_request.cc index 28ac3df84c..04af05d4e7 100644 --- a/src/components/application_manager/src/commands/hmi/vr_add_command_request.cc +++ b/src/components/application_manager/src/commands/hmi/vr_add_command_request.cc @@ -36,12 +36,11 @@ namespace application_manager { namespace commands { -VRAddCommandRequest::VRAddCommandRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} +VRAddCommandRequest::VRAddCommandRequest( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -VRAddCommandRequest::~VRAddCommandRequest() { -} +VRAddCommandRequest::~VRAddCommandRequest() {} void VRAddCommandRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,4 +51,3 @@ void VRAddCommandRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/vr_add_command_response.cc b/src/components/application_manager/src/commands/hmi/vr_add_command_response.cc index 11581af91d..496bd47605 100644 --- a/src/components/application_manager/src/commands/hmi/vr_add_command_response.cc +++ b/src/components/application_manager/src/commands/hmi/vr_add_command_response.cc @@ -38,12 +38,11 @@ namespace application_manager { namespace commands { -VRAddCommandResponse::VRAddCommandResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} +VRAddCommandResponse::VRAddCommandResponse( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -VRAddCommandResponse::~VRAddCommandResponse() { -} +VRAddCommandResponse::~VRAddCommandResponse() {} void VRAddCommandResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/vr_change_registration_request.cc b/src/components/application_manager/src/commands/hmi/vr_change_registration_request.cc index 067292ecd0..e64e7cc388 100644 --- a/src/components/application_manager/src/commands/hmi/vr_change_registration_request.cc +++ b/src/components/application_manager/src/commands/hmi/vr_change_registration_request.cc @@ -38,11 +38,9 @@ namespace commands { VRChangeRegistrationRequest::VRChangeRegistrationRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} + : RequestToHMI(message, application_manager) {} -VRChangeRegistrationRequest::~VRChangeRegistrationRequest() { -} +VRChangeRegistrationRequest::~VRChangeRegistrationRequest() {} void VRChangeRegistrationRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -53,4 +51,3 @@ void VRChangeRegistrationRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/vr_change_registration_response.cc b/src/components/application_manager/src/commands/hmi/vr_change_registration_response.cc index 1b322a5d7e..8084688c15 100644 --- a/src/components/application_manager/src/commands/hmi/vr_change_registration_response.cc +++ b/src/components/application_manager/src/commands/hmi/vr_change_registration_response.cc @@ -39,11 +39,9 @@ namespace commands { VRChangeRegistrationResponse::VRChangeRegistrationResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} + : ResponseFromHMI(message, application_manager) {} -VRChangeRegistrationResponse::~VRChangeRegistrationResponse() { -} +VRChangeRegistrationResponse::~VRChangeRegistrationResponse() {} void VRChangeRegistrationResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/vr_delete_command_request.cc b/src/components/application_manager/src/commands/hmi/vr_delete_command_request.cc index ed0924c293..1db85529da 100644 --- a/src/components/application_manager/src/commands/hmi/vr_delete_command_request.cc +++ b/src/components/application_manager/src/commands/hmi/vr_delete_command_request.cc @@ -36,12 +36,11 @@ namespace application_manager { namespace commands { -VRDeleteCommandRequest::VRDeleteCommandRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} +VRDeleteCommandRequest::VRDeleteCommandRequest( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -VRDeleteCommandRequest::~VRDeleteCommandRequest() { -} +VRDeleteCommandRequest::~VRDeleteCommandRequest() {} void VRDeleteCommandRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,4 +51,3 @@ void VRDeleteCommandRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/vr_delete_command_response.cc b/src/components/application_manager/src/commands/hmi/vr_delete_command_response.cc index 42021f23cf..08711be2c8 100644 --- a/src/components/application_manager/src/commands/hmi/vr_delete_command_response.cc +++ b/src/components/application_manager/src/commands/hmi/vr_delete_command_response.cc @@ -39,11 +39,9 @@ namespace commands { VRDeleteCommandResponse::VRDeleteCommandResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} + : ResponseFromHMI(message, application_manager) {} -VRDeleteCommandResponse::~VRDeleteCommandResponse() { -} +VRDeleteCommandResponse::~VRDeleteCommandResponse() {} void VRDeleteCommandResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/hmi/vr_get_capabilities_request.cc b/src/components/application_manager/src/commands/hmi/vr_get_capabilities_request.cc index 46f9d4a397..3159380c17 100644 --- a/src/components/application_manager/src/commands/hmi/vr_get_capabilities_request.cc +++ b/src/components/application_manager/src/commands/hmi/vr_get_capabilities_request.cc @@ -37,12 +37,10 @@ namespace application_manager { namespace commands { VRGetCapabilitiesRequest::VRGetCapabilitiesRequest( - const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -VRGetCapabilitiesRequest::~VRGetCapabilitiesRequest() { -} +VRGetCapabilitiesRequest::~VRGetCapabilitiesRequest() {} void VRGetCapabilitiesRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -53,4 +51,3 @@ void VRGetCapabilitiesRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/vr_get_capabilities_response.cc b/src/components/application_manager/src/commands/hmi/vr_get_capabilities_response.cc index f4537ed928..9aa0fc6668 100644 --- a/src/components/application_manager/src/commands/hmi/vr_get_capabilities_response.cc +++ b/src/components/application_manager/src/commands/hmi/vr_get_capabilities_response.cc @@ -31,27 +31,23 @@ */ #include "application_manager/commands/hmi/vr_get_capabilities_response.h" - namespace application_manager { namespace commands { VRGetCapabilitiesResponse::VRGetCapabilitiesResponse( - const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -VRGetCapabilitiesResponse::~VRGetCapabilitiesResponse() { -} +VRGetCapabilitiesResponse::~VRGetCapabilitiesResponse() {} void VRGetCapabilitiesResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); - HMICapabilities& hmi_capabilities = - application_manager_.hmi_capabilities(); + HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities(); hmi_capabilities.set_vr_capabilities( - (*message_)[strings::msg_params][strings::vr_capabilities]); + (*message_)[strings::msg_params][strings::vr_capabilities]); } } // namespace commands diff --git a/src/components/application_manager/src/commands/hmi/vr_get_language_request.cc b/src/components/application_manager/src/commands/hmi/vr_get_language_request.cc index 098607294d..baf34c8017 100644 --- a/src/components/application_manager/src/commands/hmi/vr_get_language_request.cc +++ b/src/components/application_manager/src/commands/hmi/vr_get_language_request.cc @@ -36,12 +36,11 @@ namespace application_manager { namespace commands { -VRGetLanguageRequest::VRGetLanguageRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} +VRGetLanguageRequest::VRGetLanguageRequest( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -VRGetLanguageRequest::~VRGetLanguageRequest() { -} +VRGetLanguageRequest::~VRGetLanguageRequest() {} void VRGetLanguageRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,4 +51,3 @@ void VRGetLanguageRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/vr_get_language_response.cc b/src/components/application_manager/src/commands/hmi/vr_get_language_response.cc index 27ff302089..a55dca44a3 100644 --- a/src/components/application_manager/src/commands/hmi/vr_get_language_response.cc +++ b/src/components/application_manager/src/commands/hmi/vr_get_language_response.cc @@ -38,12 +38,11 @@ namespace application_manager { namespace commands { -VRGetLanguageResponse::VRGetLanguageResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} +VRGetLanguageResponse::VRGetLanguageResponse( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -VRGetLanguageResponse::~VRGetLanguageResponse() { -} +VRGetLanguageResponse::~VRGetLanguageResponse() {} void VRGetLanguageResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -53,17 +52,16 @@ void VRGetLanguageResponse::Run() { if ((*message_).keyExists(strings::msg_params) && (*message_)[strings::msg_params].keyExists(hmi_response::language)) { - language = static_cast<Common_Language::eType>( - (*message_)[strings::msg_params][hmi_response::language].asInt()); + (*message_)[strings::msg_params][hmi_response::language].asInt()); } - application_manager_.hmi_capabilities(). - set_active_vr_language(language); + application_manager_.hmi_capabilities().set_active_vr_language(language); - LOG4CXX_DEBUG(logger_, "Raising event for function_id " - << function_id() - << " and correlation_id " << correlation_id()); + LOG4CXX_DEBUG(logger_, + "Raising event for function_id " << function_id() + << " and correlation_id " + << correlation_id()); event_engine::Event event(FunctionID::VR_GetLanguage); event.set_smart_object(*message_); event.raise(application_manager_.event_dispatcher()); diff --git a/src/components/application_manager/src/commands/hmi/vr_get_supported_languages_request.cc b/src/components/application_manager/src/commands/hmi/vr_get_supported_languages_request.cc index c2de988e93..def4a64699 100644 --- a/src/components/application_manager/src/commands/hmi/vr_get_supported_languages_request.cc +++ b/src/components/application_manager/src/commands/hmi/vr_get_supported_languages_request.cc @@ -38,11 +38,9 @@ namespace commands { VRGetSupportedLanguagesRequest::VRGetSupportedLanguagesRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} + : RequestToHMI(message, application_manager) {} -VRGetSupportedLanguagesRequest::~VRGetSupportedLanguagesRequest() { -} +VRGetSupportedLanguagesRequest::~VRGetSupportedLanguagesRequest() {} void VRGetSupportedLanguagesRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -53,4 +51,3 @@ void VRGetSupportedLanguagesRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/vr_get_supported_languages_response.cc b/src/components/application_manager/src/commands/hmi/vr_get_supported_languages_response.cc index a33ba3d48e..e5a6ed0b86 100644 --- a/src/components/application_manager/src/commands/hmi/vr_get_supported_languages_response.cc +++ b/src/components/application_manager/src/commands/hmi/vr_get_supported_languages_response.cc @@ -40,11 +40,9 @@ namespace commands { VRGetSupportedLanguagesResponse::VRGetSupportedLanguagesResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} + : ResponseFromHMI(message, application_manager) {} -VRGetSupportedLanguagesResponse::~VRGetSupportedLanguagesResponse() { -} +VRGetSupportedLanguagesResponse::~VRGetSupportedLanguagesResponse() {} void VRGetSupportedLanguagesResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -54,8 +52,7 @@ void VRGetSupportedLanguagesResponse::Run() { (*message_)[strings::params][hmi_response::code].asInt()); if (hmi_apis::Common_Result::SUCCESS == code) { - HMICapabilities& hmi_capabilities = - application_manager_.hmi_capabilities(); + HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities(); hmi_capabilities.set_vr_supported_languages( (*message_)[strings::msg_params][hmi_response::languages]); } diff --git a/src/components/application_manager/src/commands/hmi/vr_is_ready_request.cc b/src/components/application_manager/src/commands/hmi/vr_is_ready_request.cc index b72b5b378b..8c5e8bd49b 100644 --- a/src/components/application_manager/src/commands/hmi/vr_is_ready_request.cc +++ b/src/components/application_manager/src/commands/hmi/vr_is_ready_request.cc @@ -36,12 +36,11 @@ namespace application_manager { namespace commands { -VRIsReadyRequest::VRIsReadyRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} +VRIsReadyRequest::VRIsReadyRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : RequestToHMI(message, application_manager) {} -VRIsReadyRequest::~VRIsReadyRequest() { -} +VRIsReadyRequest::~VRIsReadyRequest() {} void VRIsReadyRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,4 +51,3 @@ void VRIsReadyRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/vr_is_ready_response.cc b/src/components/application_manager/src/commands/hmi/vr_is_ready_response.cc index 75e39120a8..617742a28c 100644 --- a/src/components/application_manager/src/commands/hmi/vr_is_ready_response.cc +++ b/src/components/application_manager/src/commands/hmi/vr_is_ready_response.cc @@ -31,17 +31,15 @@ */ #include "application_manager/commands/hmi/vr_is_ready_response.h" - namespace application_manager { namespace commands { -VRIsReadyResponse::VRIsReadyResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} +VRIsReadyResponse::VRIsReadyResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : ResponseFromHMI(message, application_manager) {} -VRIsReadyResponse::~VRIsReadyResponse() { -} +VRIsReadyResponse::~VRIsReadyResponse() {} void VRIsReadyResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -52,8 +50,7 @@ void VRIsReadyResponse::Run() { is_available = object[strings::msg_params][strings::available].asBool(); } - HMICapabilities& hmi_capabilities = - application_manager_.hmi_capabilities(); + HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities(); hmi_capabilities.set_is_vr_cooperating(is_available); } diff --git a/src/components/application_manager/src/commands/hmi/vr_perform_interaction_request.cc b/src/components/application_manager/src/commands/hmi/vr_perform_interaction_request.cc index c86f4f23b3..c4646e59f4 100644 --- a/src/components/application_manager/src/commands/hmi/vr_perform_interaction_request.cc +++ b/src/components/application_manager/src/commands/hmi/vr_perform_interaction_request.cc @@ -38,11 +38,9 @@ namespace commands { VRPerformInteractionRequest::VRPerformInteractionRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) - : RequestToHMI(message, application_manager) { -} + : RequestToHMI(message, application_manager) {} -VRPerformInteractionRequest::~VRPerformInteractionRequest() { -} +VRPerformInteractionRequest::~VRPerformInteractionRequest() {} void VRPerformInteractionRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -53,4 +51,3 @@ void VRPerformInteractionRequest::Run() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/hmi/vr_perform_interaction_response.cc b/src/components/application_manager/src/commands/hmi/vr_perform_interaction_response.cc index a8b8231114..bb5ceb3755 100644 --- a/src/components/application_manager/src/commands/hmi/vr_perform_interaction_response.cc +++ b/src/components/application_manager/src/commands/hmi/vr_perform_interaction_response.cc @@ -38,11 +38,9 @@ namespace commands { VRPerformInteractionResponse::VRPerformInteractionResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : ResponseFromHMI(message, application_manager) { -} + : ResponseFromHMI(message, application_manager) {} -VRPerformInteractionResponse::~VRPerformInteractionResponse() { -} +VRPerformInteractionResponse::~VRPerformInteractionResponse() {} void VRPerformInteractionResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/add_command_request.cc b/src/components/application_manager/src/commands/mobile/add_command_request.cc index 6f45826d5a..03bdfadd66 100644 --- a/src/components/application_manager/src/commands/mobile/add_command_request.cc +++ b/src/components/application_manager/src/commands/mobile/add_command_request.cc @@ -46,18 +46,17 @@ namespace commands { namespace custom_str = utils::custom_string; -AddCommandRequest::AddCommandRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager), - send_ui_(false), - send_vr_(false), - is_ui_received_(false), - is_vr_received_(false), - ui_result_(hmi_apis::Common_Result::INVALID_ENUM), - vr_result_(hmi_apis::Common_Result::INVALID_ENUM) { -} - -AddCommandRequest::~AddCommandRequest() { -} +AddCommandRequest::AddCommandRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : CommandRequestImpl(message, application_manager) + , send_ui_(false) + , send_vr_(false) + , is_ui_received_(false) + , is_vr_received_(false) + , ui_result_(hmi_apis::Common_Result::INVALID_ENUM) + , vr_result_(hmi_apis::Common_Result::INVALID_ENUM) {} + +AddCommandRequest::~AddCommandRequest() {} void AddCommandRequest::onTimeOut() { LOG4CXX_AUTO_TRACE(logger_); @@ -78,14 +77,14 @@ void AddCommandRequest::Run() { } if ((*message_)[strings::msg_params].keyExists(strings::cmd_icon)) { - mobile_apis::Result::eType verification_result = - MessageHelper::VerifyImage((*message_)[strings::msg_params] - [strings::cmd_icon], app, application_manager_); + mobile_apis::Result::eType verification_result = MessageHelper::VerifyImage( + (*message_)[strings::msg_params][strings::cmd_icon], + app, + application_manager_); if (mobile_apis::Result::SUCCESS != verification_result) { LOG4CXX_ERROR( - logger_, - "MessageHelper::VerifyImage return " << verification_result); + logger_, "MessageHelper::VerifyImage return " << verification_result); SendResponse(false, verification_result); return; } @@ -98,13 +97,13 @@ void AddCommandRequest::Run() { } if (app->FindCommand( - (*message_)[strings::msg_params][strings::cmd_id].asUInt())) { + (*message_)[strings::msg_params][strings::cmd_id].asUInt())) { LOG4CXX_ERROR(logger_, "INVALID_ID"); SendResponse(false, mobile_apis::Result::INVALID_ID); return; } - bool data_exist = false; + bool data_exist = false; if ((*message_)[strings::msg_params].keyExists(strings::menu_params)) { if (!CheckCommandName(app)) { @@ -112,21 +111,21 @@ void AddCommandRequest::Run() { return; } 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())) { + hmi_request::parent_id)) && + (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"); + SendResponse( + false, mobile_apis::Result::INVALID_ID, "Parent ID doesn't exist"); return; } } data_exist = true; } - if (((*message_)[strings::msg_params].keyExists(strings::vr_commands)) - && ((*message_)[strings::msg_params] - [strings::vr_commands].length() > 0)) { - + if (((*message_)[strings::msg_params].keyExists(strings::vr_commands)) && + ((*message_)[strings::msg_params][strings::vr_commands].length() > 0)) { if (!CheckCommandVRSynonym(app)) { SendResponse(false, mobile_apis::Result::DUPLICATE_NAME); return; @@ -142,18 +141,16 @@ void AddCommandRequest::Run() { } if (IsWhiteSpaceExist()) { - LOG4CXX_ERROR(logger_, - "Incoming add command has contains \t\n \\t \\n"); + LOG4CXX_ERROR(logger_, "Incoming add command has contains \t\n \\t \\n"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } - app->AddCommand((*message_)[strings::msg_params] - [strings::cmd_id].asUInt(), - (*message_)[strings::msg_params]); + app->AddCommand((*message_)[strings::msg_params][strings::cmd_id].asUInt(), + (*message_)[strings::msg_params]); - smart_objects::SmartObject ui_msg_params = smart_objects::SmartObject( - smart_objects::SmartType_Map); + smart_objects::SmartObject ui_msg_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); if ((*message_)[strings::msg_params].keyExists(strings::menu_params)) { ui_msg_params[strings::cmd_id] = (*message_)[strings::msg_params][strings::cmd_id]; @@ -162,10 +159,11 @@ void AddCommandRequest::Run() { ui_msg_params[strings::app_id] = app->app_id(); - if ( ((*message_)[strings::msg_params].keyExists(strings::cmd_icon)) - && ((*message_)[strings::msg_params][strings::cmd_icon].keyExists(strings::value)) - && (0 < (*message_)[strings::msg_params][strings::cmd_icon] - [strings::value].length())) { + if (((*message_)[strings::msg_params].keyExists(strings::cmd_icon)) && + ((*message_)[strings::msg_params][strings::cmd_icon].keyExists( + strings::value)) && + (0 < (*message_)[strings::msg_params][strings::cmd_icon][strings::value] + .length())) { ui_msg_params[strings::cmd_icon] = (*message_)[strings::msg_params][strings::cmd_icon]; } @@ -173,8 +171,8 @@ void AddCommandRequest::Run() { send_ui_ = true; } - smart_objects::SmartObject vr_msg_params = smart_objects::SmartObject( - smart_objects::SmartType_Map); + smart_objects::SmartObject vr_msg_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); if ((*message_)[strings::msg_params].keyExists(strings::vr_commands)) { vr_msg_params[strings::cmd_id] = (*message_)[strings::msg_params][strings::cmd_id]; @@ -207,10 +205,10 @@ bool AddCommandRequest::CheckCommandName(ApplicationConstSharedPtr app) { CommandsMap::const_iterator i = commands.begin(); uint32_t saved_parent_id = 0; uint32_t parent_id = 0; - 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(); + 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(); } for (; commands.end() != i; ++i) { @@ -220,13 +218,15 @@ bool AddCommandRequest::CheckCommandName(ApplicationConstSharedPtr app) { saved_parent_id = 0; if ((*i->second)[strings::menu_params].keyExists(hmi_request::parent_id)) { - saved_parent_id = (*i->second)[strings::menu_params][hmi_request::parent_id].asUInt(); + saved_parent_id = + (*i->second)[strings::menu_params][hmi_request::parent_id].asUInt(); } - if (((*i->second)[strings::menu_params][strings::menu_name].asString() - == (*message_)[strings::msg_params][strings::menu_params] - [strings::menu_name].asString()) && + if (((*i->second)[strings::menu_params][strings::menu_name].asString() == + (*message_)[strings::msg_params][strings::menu_params] + [strings::menu_name].asString()) && (saved_parent_id == parent_id)) { - LOG4CXX_INFO(logger_, "AddCommandRequest::CheckCommandName received" + LOG4CXX_INFO(logger_, + "AddCommandRequest::CheckCommandName received" " command name already exist in same level menu"); return false; } @@ -244,23 +244,23 @@ bool AddCommandRequest::CheckCommandVRSynonym(ApplicationConstSharedPtr app) { CommandsMap::const_iterator it = commands.begin(); for (; commands.end() != it; ++it) { - - if(!(*it->second).keyExists(strings::vr_commands)) { + if (!(*it->second).keyExists(strings::vr_commands)) { continue; } for (size_t i = 0; i < (*it->second)[strings::vr_commands].length(); ++i) { for (size_t j = 0; - j < (*message_)[strings::msg_params][strings::vr_commands].length(); - ++j) { + j < (*message_)[strings::msg_params][strings::vr_commands].length(); + ++j) { const custom_str::CustomString& vr_cmd_i = (*it->second)[strings::vr_commands][i].asCustomString(); const custom_str::CustomString& vr_cmd_j = - (*message_)[strings::msg_params] - [strings::vr_commands][j].asCustomString(); + (*message_)[strings::msg_params][strings::vr_commands][j] + .asCustomString(); if (vr_cmd_i.CompareIgnoreCase(vr_cmd_j)) { - LOG4CXX_INFO(logger_, "AddCommandRequest::CheckCommandVRSynonym" + LOG4CXX_INFO(logger_, + "AddCommandRequest::CheckCommandVRSynonym" " received command vr synonym already exist"); return false; } @@ -277,11 +277,12 @@ 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) { - LOG4CXX_INFO(logger_, "AddCommandRequest::CheckCommandParentId received" + LOG4CXX_INFO(logger_, + "AddCommandRequest::CheckCommandParentId received" " submenu doesn't exist"); return false; } @@ -303,7 +304,8 @@ void AddCommandRequest::on_event(const event_engine::Event& event) { } smart_objects::SmartObject msg_param(smart_objects::SmartType_Map); - msg_param[strings::cmd_id] = (*message_)[strings::msg_params][strings::cmd_id]; + msg_param[strings::cmd_id] = + (*message_)[strings::msg_params][strings::cmd_id]; msg_param[strings::app_id] = application->app_id(); switch (event.id()) { @@ -330,7 +332,7 @@ void AddCommandRequest::on_event(const event_engine::Event& event) { break; } default: { - LOG4CXX_ERROR(logger_,"Received unknown event" << event.id()); + LOG4CXX_ERROR(logger_, "Received unknown event" << event.id()); return; } } @@ -344,93 +346,83 @@ void AddCommandRequest::on_event(const event_engine::Event& event) { } smart_objects::SmartObject msg_params(smart_objects::SmartType_Map); - msg_params[strings::cmd_id] = (*message_)[strings::msg_params][strings::cmd_id]; + msg_params[strings::cmd_id] = + (*message_)[strings::msg_params][strings::cmd_id]; msg_params[strings::app_id] = application->app_id(); mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM; const bool is_vr_invalid_unsupported = Compare<hmi_apis::Common_Result::eType, EQ, ONE>( - vr_result_, - hmi_apis::Common_Result::INVALID_ENUM, - hmi_apis::Common_Result::UNSUPPORTED_RESOURCE); + vr_result_, + hmi_apis::Common_Result::INVALID_ENUM, + hmi_apis::Common_Result::UNSUPPORTED_RESOURCE); const bool is_ui_ivalid_unsupported = Compare<hmi_apis::Common_Result::eType, EQ, ONE>( - ui_result_, - hmi_apis::Common_Result::INVALID_ENUM, - hmi_apis::Common_Result::UNSUPPORTED_RESOURCE); + ui_result_, + hmi_apis::Common_Result::INVALID_ENUM, + hmi_apis::Common_Result::UNSUPPORTED_RESOURCE); - const bool is_no_ui_error = - Compare<hmi_apis::Common_Result::eType, EQ, ONE>( - ui_result_, - hmi_apis::Common_Result::SUCCESS, - hmi_apis::Common_Result::WARNINGS); + const bool is_no_ui_error = Compare<hmi_apis::Common_Result::eType, EQ, ONE>( + ui_result_, + hmi_apis::Common_Result::SUCCESS, + hmi_apis::Common_Result::WARNINGS); - const bool is_no_vr_error = - Compare<hmi_apis::Common_Result::eType, EQ, ONE>( - vr_result_, - hmi_apis::Common_Result::SUCCESS, - hmi_apis::Common_Result::WARNINGS); + const bool is_no_vr_error = Compare<hmi_apis::Common_Result::eType, EQ, ONE>( + vr_result_, + hmi_apis::Common_Result::SUCCESS, + hmi_apis::Common_Result::WARNINGS); - bool result = - (is_no_ui_error && is_no_vr_error) || - (is_no_ui_error && is_vr_invalid_unsupported) || - (is_no_vr_error && is_ui_ivalid_unsupported); + bool result = (is_no_ui_error && is_no_vr_error) || + (is_no_ui_error && is_vr_invalid_unsupported) || + (is_no_vr_error && is_ui_ivalid_unsupported); const bool is_vr_or_ui_warning = Compare<hmi_apis::Common_Result::eType, EQ, ONE>( - hmi_apis::Common_Result::WARNINGS, - ui_result_, - vr_result_); + hmi_apis::Common_Result::WARNINGS, ui_result_, vr_result_); - if (!result && - hmi_apis::Common_Result::REJECTED == ui_result_) { + if (!result && hmi_apis::Common_Result::REJECTED == ui_result_) { result_code = MessageHelper::HMIToMobileResult(ui_result_); } else if (is_vr_or_ui_warning) { result_code = mobile_apis::Result::WARNINGS; } else { - result_code = MessageHelper::HMIToMobileResult( - std::max(ui_result_, vr_result_)); + result_code = + MessageHelper::HMIToMobileResult(std::max(ui_result_, vr_result_)); } if (BothSend() && hmi_apis::Common_Result::SUCCESS == vr_result_) { - const bool is_ui_not_ok = - Compare<hmi_apis::Common_Result::eType, NEQ, ALL>( - ui_result_, - hmi_apis::Common_Result::SUCCESS, - hmi_apis::Common_Result::WARNINGS, - hmi_apis::Common_Result::UNSUPPORTED_RESOURCE); + const bool is_ui_not_ok = Compare<hmi_apis::Common_Result::eType, NEQ, ALL>( + ui_result_, + hmi_apis::Common_Result::SUCCESS, + hmi_apis::Common_Result::WARNINGS, + hmi_apis::Common_Result::UNSUPPORTED_RESOURCE); if (is_ui_not_ok) { - result_code = - ui_result_ == hmi_apis::Common_Result::REJECTED - ? mobile_apis::Result::REJECTED - : mobile_apis::Result::GENERIC_ERROR; + result_code = ui_result_ == hmi_apis::Common_Result::REJECTED + ? mobile_apis::Result::REJECTED + : mobile_apis::Result::GENERIC_ERROR; msg_params[strings::grammar_id] = application->get_grammar_id(); msg_params[strings::type] = hmi_apis::Common_VRCommandType::Command; SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_params); - application->RemoveCommand((*message_)[strings::msg_params] - [strings::cmd_id].asUInt()); + application->RemoveCommand( + (*message_)[strings::msg_params][strings::cmd_id].asUInt()); result = false; } } - if(BothSend() && - hmi_apis::Common_Result::SUCCESS == ui_result_ && - !is_no_vr_error) { - - result_code = - vr_result_ == hmi_apis::Common_Result::REJECTED - ? mobile_apis::Result::REJECTED : - mobile_apis::Result::GENERIC_ERROR; + if (BothSend() && hmi_apis::Common_Result::SUCCESS == ui_result_ && + !is_no_vr_error) { + result_code = vr_result_ == hmi_apis::Common_Result::REJECTED + ? mobile_apis::Result::REJECTED + : mobile_apis::Result::GENERIC_ERROR; SendHMIRequest(hmi_apis::FunctionID::UI_DeleteCommand, &msg_params); - application->RemoveCommand((*message_)[strings::msg_params] - [strings::cmd_id].asUInt()); + application->RemoveCommand( + (*message_)[strings::msg_params][strings::cmd_id].asUInt()); result = false; } @@ -451,7 +443,7 @@ 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; @@ -463,8 +455,8 @@ bool AddCommandRequest::IsWhiteSpaceExist() { (*message_)[strings::msg_params][strings::vr_commands].length(); for (size_t i = 0; i < len; ++i) { - str = (*message_)[strings::msg_params] - [strings::vr_commands][i].asCharArray(); + str = (*message_)[strings::msg_params][strings::vr_commands][i] + .asCharArray(); if (!CheckSyntax(str)) { LOG4CXX_ERROR(logger_, "Invalid vr_commands syntax check failed"); return true; @@ -473,8 +465,8 @@ bool AddCommandRequest::IsWhiteSpaceExist() { } if ((*message_)[strings::msg_params].keyExists(strings::cmd_icon)) { - str = (*message_)[strings::msg_params] - [strings::cmd_icon][strings::value].asCharArray(); + str = (*message_)[strings::msg_params][strings::cmd_icon][strings::value] + .asCharArray(); if (!CheckSyntax(str)) { LOG4CXX_ERROR(logger_, "Invalid cmd_icon value syntax check failed"); return true; @@ -489,19 +481,19 @@ bool AddCommandRequest::BothSend() const { void AddCommandRequest::RemoveCommand() { LOG4CXX_AUTO_TRACE(logger_); - ApplicationSharedPtr app = application_manager_.application( - connection_key()); + ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app.valid()) { LOG4CXX_ERROR(logger_, "No application associated with session key"); return; } smart_objects::SmartObject msg_params(smart_objects::SmartType_Map); - msg_params[strings::cmd_id] = (*message_)[strings::msg_params][strings::cmd_id]; + msg_params[strings::cmd_id] = + (*message_)[strings::msg_params][strings::cmd_id]; msg_params[strings::app_id] = app->app_id(); - app->RemoveCommand((*message_)[strings::msg_params] - [strings::cmd_id].asUInt()); + app->RemoveCommand( + (*message_)[strings::msg_params][strings::cmd_id].asUInt()); if (BothSend() && !(is_vr_received_ || is_ui_received_)) { // in case we have send bth UI and VR and no one respond diff --git a/src/components/application_manager/src/commands/mobile/add_command_response.cc b/src/components/application_manager/src/commands/mobile/add_command_response.cc index 21f881a574..fc468f9c57 100644 --- a/src/components/application_manager/src/commands/mobile/add_command_response.cc +++ b/src/components/application_manager/src/commands/mobile/add_command_response.cc @@ -33,17 +33,15 @@ #include "application_manager/commands/mobile/add_command_response.h" - namespace application_manager { namespace commands { -AddCommandResponse::AddCommandResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} +AddCommandResponse::AddCommandResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : CommandResponseImpl(message, application_manager) {} -AddCommandResponse::~AddCommandResponse() { -} +AddCommandResponse::~AddCommandResponse() {} void AddCommandResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/add_sub_menu_request.cc b/src/components/application_manager/src/commands/mobile/add_sub_menu_request.cc index c1d364b6cd..83f137ac19 100644 --- a/src/components/application_manager/src/commands/mobile/add_sub_menu_request.cc +++ b/src/components/application_manager/src/commands/mobile/add_sub_menu_request.cc @@ -40,18 +40,16 @@ namespace application_manager { namespace commands { -AddSubMenuRequest::AddSubMenuRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager) { -} +AddSubMenuRequest::AddSubMenuRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : CommandRequestImpl(message, application_manager) {} -AddSubMenuRequest::~AddSubMenuRequest() { -} +AddSubMenuRequest::~AddSubMenuRequest() {} void AddSubMenuRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); - ApplicationSharedPtr app = application_manager_.application( - connection_key()); + ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { LOG4CXX_ERROR(logger_, "NULL pointer"); @@ -82,14 +80,14 @@ void AddSubMenuRequest::Run() { return; } - smart_objects::SmartObject msg_params = smart_objects::SmartObject( - smart_objects::SmartType_Map); + smart_objects::SmartObject msg_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); msg_params[strings::menu_id] = (*message_)[strings::msg_params][strings::menu_id]; if ((*message_)[strings::msg_params].keyExists(strings::position)) { - msg_params[strings::menu_params][strings::position] = - (*message_)[strings::msg_params][strings::position]; + msg_params[strings::menu_params][strings::position] = + (*message_)[strings::msg_params][strings::position]; } msg_params[strings::menu_params][strings::menu_name] = (*message_)[strings::msg_params][strings::menu_name]; @@ -109,14 +107,13 @@ void AddSubMenuRequest::on_event(const event_engine::Event& event) { static_cast<mobile_apis::Result::eType>( message[strings::params][hmi_response::code].asInt()); - const bool result = - Compare<mobile_api::Result::eType, EQ, ONE>( - result_code, - mobile_api::Result::SUCCESS, - mobile_api::Result::WARNINGS); + const bool result = Compare<mobile_api::Result::eType, EQ, ONE>( + result_code, + mobile_api::Result::SUCCESS, + mobile_api::Result::WARNINGS); ApplicationSharedPtr application = - application_manager_.application(connection_key()); + application_manager_.application(connection_key()); if (!application) { LOG4CXX_ERROR(logger_, "NULL pointer"); @@ -124,10 +121,10 @@ void AddSubMenuRequest::on_event(const event_engine::Event& event) { } if (result) { - application->AddSubMenu((*message_)[strings::msg_params] - [strings::menu_id].asInt(), - (*message_)[strings::msg_params]); - } + application->AddSubMenu( + (*message_)[strings::msg_params][strings::menu_id].asInt(), + (*message_)[strings::msg_params]); + } SendResponse(result, result_code, NULL, &(message[strings::msg_params])); if (result) { application->UpdateHash(); diff --git a/src/components/application_manager/src/commands/mobile/add_sub_menu_response.cc b/src/components/application_manager/src/commands/mobile/add_sub_menu_response.cc index 02672edadd..1fbdb4e66c 100644 --- a/src/components/application_manager/src/commands/mobile/add_sub_menu_response.cc +++ b/src/components/application_manager/src/commands/mobile/add_sub_menu_response.cc @@ -39,12 +39,11 @@ namespace application_manager { namespace commands { -AddSubMenuResponse::AddSubMenuResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} +AddSubMenuResponse::AddSubMenuResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : CommandResponseImpl(message, application_manager) {} -AddSubMenuResponse::~AddSubMenuResponse() { -} +AddSubMenuResponse::~AddSubMenuResponse() {} void AddSubMenuResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc b/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc index 7c0c557b62..d771553962 100644 --- a/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc +++ b/src/components/application_manager/src/commands/mobile/alert_maneuver_request.cc @@ -43,15 +43,15 @@ namespace application_manager { namespace commands { -AlertManeuverRequest::AlertManeuverRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager), - tts_speak_result_code_(mobile_apis::Result::INVALID_ENUM), - navi_alert_maneuver_result_code_(mobile_apis::Result::INVALID_ENUM) { +AlertManeuverRequest::AlertManeuverRequest( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : CommandRequestImpl(message, application_manager) + , tts_speak_result_code_(mobile_apis::Result::INVALID_ENUM) + , navi_alert_maneuver_result_code_(mobile_apis::Result::INVALID_ENUM) { subscribe_on_event(hmi_apis::FunctionID::TTS_OnResetTimeout); } -AlertManeuverRequest::~AlertManeuverRequest() { -} +AlertManeuverRequest::~AlertManeuverRequest() {} void AlertManeuverRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -80,11 +80,13 @@ void AlertManeuverRequest::Run() { return; } - //ProcessSoftButtons checks strings on the contents incorrect character + // ProcessSoftButtons checks strings on the contents incorrect character mobile_apis::Result::eType processing_result = - MessageHelper::ProcessSoftButtons((*message_)[strings::msg_params], app, - application_manager_.GetPolicyHandler(), application_manager_); + MessageHelper::ProcessSoftButtons((*message_)[strings::msg_params], + app, + application_manager_.GetPolicyHandler(), + application_manager_); if (mobile_apis::Result::SUCCESS != processing_result) { LOG4CXX_ERROR(logger_, "Wrong soft buttons parameters!"); @@ -103,25 +105,25 @@ void AlertManeuverRequest::Run() { } } - smart_objects::SmartObject msg_params = smart_objects::SmartObject( - smart_objects::SmartType_Map); + smart_objects::SmartObject msg_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); msg_params[strings::app_id] = app->app_id(); if ((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) { msg_params[hmi_request::soft_buttons] = - (*message_)[strings::msg_params][strings::soft_buttons]; - MessageHelper::SubscribeApplicationToSoftButton((*message_)[strings::msg_params], - app, function_id()); + (*message_)[strings::msg_params][strings::soft_buttons]; + MessageHelper::SubscribeApplicationToSoftButton( + (*message_)[strings::msg_params], app, function_id()); } pending_requests_.Add(hmi_apis::FunctionID::Navigation_AlertManeuver); - SendHMIRequest(hmi_apis::FunctionID::Navigation_AlertManeuver, - &msg_params, true); + SendHMIRequest( + hmi_apis::FunctionID::Navigation_AlertManeuver, &msg_params, true); if (tts_is_ok) { - smart_objects::SmartObject msg_params = smart_objects::SmartObject( - smart_objects::SmartType_Map); + smart_objects::SmartObject msg_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); msg_params[hmi_request::tts_chunks] = (*message_)[strings::msg_params][strings::tts_chunks]; @@ -146,7 +148,7 @@ void AlertManeuverRequest::on_event(const event_engine::Event& event) { navi_alert_maneuver_result_code_ = static_cast<mobile_apis::Result::eType>( - message[strings::params][hmi_response::code].asInt()); + message[strings::params][hmi_response::code].asInt()); break; } @@ -155,8 +157,7 @@ void AlertManeuverRequest::on_event(const event_engine::Event& event) { pending_requests_.Remove(event_id); - tts_speak_result_code_ = - static_cast<mobile_apis::Result::eType>( + tts_speak_result_code_ = static_cast<mobile_apis::Result::eType>( message[strings::params][hmi_response::code].asInt()); break; @@ -169,9 +170,9 @@ void AlertManeuverRequest::on_event(const event_engine::Event& event) { break; } default: { - LOG4CXX_ERROR(logger_,"Received unknown event" << event.id()); - SendResponse(false, mobile_apis::Result::INVALID_ENUM, - "Received unknown event"); + LOG4CXX_ERROR(logger_, "Received unknown event" << event.id()); + SendResponse( + false, mobile_apis::Result::INVALID_ENUM, "Received unknown event"); return; } } @@ -189,47 +190,44 @@ void AlertManeuverRequest::on_event(const event_engine::Event& event) { hmi_apis::Common_Result::eType navi_result = MessageHelper::MobileToHMIResult(navi_alert_maneuver_result_code_); - const bool is_tts_ok = - Compare<hmi_apis::Common_Result::eType, EQ, ONE>( - tts_result, - hmi_apis::Common_Result::SUCCESS, - hmi_apis::Common_Result::UNSUPPORTED_RESOURCE, - hmi_apis::Common_Result::WARNINGS, - hmi_apis::Common_Result::INVALID_ENUM); + const bool is_tts_ok = Compare<hmi_apis::Common_Result::eType, EQ, ONE>( + tts_result, + hmi_apis::Common_Result::SUCCESS, + hmi_apis::Common_Result::UNSUPPORTED_RESOURCE, + hmi_apis::Common_Result::WARNINGS, + hmi_apis::Common_Result::INVALID_ENUM); const bool is_no_navi_error = Compare<hmi_apis::Common_Result::eType, EQ, ONE>( - navi_result, - hmi_apis::Common_Result::SUCCESS, - hmi_apis::Common_Result::WARNINGS); + navi_result, + hmi_apis::Common_Result::SUCCESS, + hmi_apis::Common_Result::WARNINGS); const bool result = (is_tts_ok && is_no_navi_error) || (hmi_apis::Common_Result::SUCCESS == tts_result && - hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == navi_result ); + hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == navi_result); mobile_apis::Result::eType result_code = static_cast<mobile_apis::Result::eType>( - std::max(tts_speak_result_code_, navi_alert_maneuver_result_code_)); + std::max(tts_speak_result_code_, navi_alert_maneuver_result_code_)); std::string return_info = message[strings::msg_params][hmi_response::message].asString(); const bool is_tts_or_navi_warning = Compare<hmi_apis::Common_Result::eType, EQ, ONE>( - hmi_apis::Common_Result::WARNINGS, - tts_result, - navi_result); + hmi_apis::Common_Result::WARNINGS, tts_result, navi_result); - if (result && - (is_tts_or_navi_warning || - hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == tts_result)) { + if (result && (is_tts_or_navi_warning || + hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == tts_result)) { result_code = mobile_apis::Result::WARNINGS; - return_info = - std::string("Unsupported phoneme type sent in a prompt"); + return_info = std::string("Unsupported phoneme type sent in a prompt"); } - SendResponse(result, result_code, return_info.c_str(), + SendResponse(result, + result_code, + return_info.c_str(), &(message[strings::msg_params])); } diff --git a/src/components/application_manager/src/commands/mobile/alert_maneuver_response.cc b/src/components/application_manager/src/commands/mobile/alert_maneuver_response.cc index c1c2cdafc0..2f441594c2 100644 --- a/src/components/application_manager/src/commands/mobile/alert_maneuver_response.cc +++ b/src/components/application_manager/src/commands/mobile/alert_maneuver_response.cc @@ -39,12 +39,11 @@ namespace application_manager { namespace commands { -AlertManeuverResponse::AlertManeuverResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} +AlertManeuverResponse::AlertManeuverResponse( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : CommandResponseImpl(message, application_manager) {} -AlertManeuverResponse::~AlertManeuverResponse() { -} +AlertManeuverResponse::~AlertManeuverResponse() {} void AlertManeuverResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/alert_request.cc b/src/components/application_manager/src/commands/mobile/alert_request.cc index 66ce432a95..53910a05b7 100644 --- a/src/components/application_manager/src/commands/mobile/alert_request.cc +++ b/src/components/application_manager/src/commands/mobile/alert_request.cc @@ -47,21 +47,21 @@ namespace commands { namespace smart_objects = NsSmartDeviceLink::NsSmartObjects; -AlertRequest::AlertRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager), - awaiting_ui_alert_response_(false), - awaiting_tts_speak_response_(false), - awaiting_tts_stop_speaking_response_(false), - is_alert_succeeded_(false), - is_ui_alert_sent_(false), - alert_result_(mobile_apis::Result::INVALID_ENUM), - tts_speak_result_(mobile_apis::Result::INVALID_ENUM) { +AlertRequest::AlertRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : CommandRequestImpl(message, application_manager) + , awaiting_ui_alert_response_(false) + , awaiting_tts_speak_response_(false) + , awaiting_tts_stop_speaking_response_(false) + , is_alert_succeeded_(false) + , is_ui_alert_sent_(false) + , alert_result_(mobile_apis::Result::INVALID_ENUM) + , tts_speak_result_(mobile_apis::Result::INVALID_ENUM) { subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout); subscribe_on_event(hmi_apis::FunctionID::TTS_OnResetTimeout); } -AlertRequest::~AlertRequest() { -} +AlertRequest::~AlertRequest() {} bool AlertRequest::Init() { /* Timeout in milliseconds. @@ -74,9 +74,11 @@ bool AlertRequest::Init() { default_timeout_ = def_value; } - // If soft buttons are present, SDL will not use initiate timeout tracking for response. + // If soft buttons are present, SDL will not use initiate timeout tracking for + // response. if ((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) { - LOG4CXX_INFO(logger_, "Request contains soft buttons - request timeout " + LOG4CXX_INFO(logger_, + "Request contains soft buttons - request timeout " "will be set to 0."); default_timeout_ = 0; } @@ -87,23 +89,25 @@ bool AlertRequest::Init() { void AlertRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); - uint32_t app_id = (*message_)[strings::params][strings::connection_key] - .asInt(); + uint32_t app_id = + (*message_)[strings::params][strings::connection_key].asInt(); if (!Validate(app_id)) { // Invalid command, abort execution return; } - bool tts_chunks_exists = (*message_)[strings::msg_params].keyExists(strings::tts_chunks); + bool tts_chunks_exists = + (*message_)[strings::msg_params].keyExists(strings::tts_chunks); size_t length_tts_chunks = 0; if (tts_chunks_exists) { - length_tts_chunks = (*message_)[strings::msg_params][strings::tts_chunks].length(); + length_tts_chunks = + (*message_)[strings::msg_params][strings::tts_chunks].length(); } if ((tts_chunks_exists && length_tts_chunks) || ((*message_)[strings::msg_params].keyExists(strings::play_tone) && - (*message_)[strings::msg_params][strings::play_tone].asBool())) { + (*message_)[strings::msg_params][strings::play_tone].asBool())) { awaiting_tts_speak_response_ = true; } @@ -115,11 +119,13 @@ void AlertRequest::Run() { void AlertRequest::onTimeOut() { LOG4CXX_AUTO_TRACE(logger_); - if (false == (*message_)[strings::msg_params].keyExists(strings::soft_buttons)) { + if (false == + (*message_)[strings::msg_params].keyExists(strings::soft_buttons)) { CommandRequestImpl::onTimeOut(); return; } - LOG4CXX_INFO(logger_, "Default timeout ignored. " + LOG4CXX_INFO(logger_, + "Default timeout ignored. " "AlertRequest with soft buttons wait timeout on HMI side"); } @@ -132,11 +138,12 @@ void AlertRequest::on_event(const event_engine::Event& event) { switch (event.id()) { case hmi_apis::FunctionID::TTS_OnResetTimeout: case hmi_apis::FunctionID::UI_OnResetTimeout: { - LOG4CXX_INFO(logger_, "Received UI_OnResetTimeout event " - " or TTS_OnResetTimeout event" - << awaiting_tts_speak_response_ << " " - << awaiting_tts_stop_speaking_response_ << " " - << awaiting_ui_alert_response_); + LOG4CXX_INFO(logger_, + "Received UI_OnResetTimeout event " + " or TTS_OnResetTimeout event" + << awaiting_tts_speak_response_ << " " + << awaiting_tts_stop_speaking_response_ << " " + << awaiting_ui_alert_response_); application_manager_.updateRequestTimeout( connection_key(), correlation_id(), default_timeout()); break; @@ -157,12 +164,11 @@ void AlertRequest::on_event(const event_engine::Event& event) { message[strings::params][hmi_response::code].asInt()); // Mobile Alert request is successful when UI_Alert is successful - const bool is_alert_ok = - Compare<mobile_api::Result::eType, EQ, ONE>( - result_code, - mobile_apis::Result::SUCCESS, - mobile_apis::Result::UNSUPPORTED_RESOURCE, - mobile_apis::Result::WARNINGS); + const bool is_alert_ok = Compare<mobile_api::Result::eType, EQ, ONE>( + result_code, + mobile_apis::Result::SUCCESS, + mobile_apis::Result::UNSUPPORTED_RESOURCE, + mobile_apis::Result::WARNINGS); is_alert_succeeded_ = is_alert_ok; alert_result_ = result_code; @@ -186,7 +192,7 @@ void AlertRequest::on_event(const event_engine::Event& event) { break; } default: { - LOG4CXX_ERROR(logger_,"Received unknown event" << event.id()); + LOG4CXX_ERROR(logger_, "Received unknown event" << event.id()); return; } } @@ -197,15 +203,12 @@ void AlertRequest::on_event(const event_engine::Event& event) { const bool is_tts_alert_unsupported = Compare<mobile_api::Result::eType, EQ, ALL>( - mobile_api::Result::UNSUPPORTED_RESOURCE, - tts_speak_result_, - alert_result_); + mobile_api::Result::UNSUPPORTED_RESOURCE, + tts_speak_result_, + alert_result_); - const bool is_alert_ok = - Compare<mobile_api::Result::eType, EQ, ONE>( - alert_result_, - mobile_api::Result::SUCCESS, - mobile_api::Result::WARNINGS); + const bool is_alert_ok = Compare<mobile_api::Result::eType, EQ, ONE>( + alert_result_, mobile_api::Result::SUCCESS, mobile_api::Result::WARNINGS); std::string response_info; if (mobile_apis::Result::UNSUPPORTED_RESOURCE == tts_speak_result_ && @@ -215,24 +218,24 @@ void AlertRequest::on_event(const event_engine::Event& event) { response_info = "Unsupported phoneme type sent in a prompt"; } else if (is_tts_alert_unsupported) { alert_result_ = mobile_apis::Result::WARNINGS; - response_info = "Unsupported phoneme type sent in a prompt and " + response_info = + "Unsupported phoneme type sent in a prompt and " "unsupported image sent in soft buttons"; } else if (mobile_apis::Result::UNSUPPORTED_RESOURCE == tts_speak_result_ && is_alert_ok) { alert_result_ = mobile_apis::Result::WARNINGS; response_info = "Unsupported phoneme type sent in a prompt"; } else if (mobile_apis::Result::SUCCESS == tts_speak_result_ && - (mobile_apis::Result::INVALID_ENUM == alert_result_ && - !is_ui_alert_sent_)) { + (mobile_apis::Result::INVALID_ENUM == alert_result_ && + !is_ui_alert_sent_)) { alert_result_ = mobile_apis::Result::SUCCESS; is_alert_succeeded_ = true; } const bool is_tts_not_ok = - Compare<mobile_api::Result::eType, EQ, ONE>( - tts_speak_result_, - mobile_api::Result::ABORTED, - mobile_api::Result::REJECTED); + Compare<mobile_api::Result::eType, EQ, ONE>(tts_speak_result_, + mobile_api::Result::ABORTED, + mobile_api::Result::REJECTED); if (is_tts_not_ok && !is_ui_alert_sent_) { is_alert_succeeded_ = false; @@ -243,15 +246,15 @@ void AlertRequest::on_event(const event_engine::Event& event) { alert_result_ = mobile_apis::Result::WARNINGS; } - SendResponse(is_alert_succeeded_, alert_result_, + SendResponse(is_alert_succeeded_, + alert_result_, response_info.empty() ? NULL : response_info.c_str(), &alert_response_params_); } bool AlertRequest::Validate(uint32_t app_id) { LOG4CXX_AUTO_TRACE(logger_); - ApplicationSharedPtr app = - application_manager_.application(app_id); + ApplicationSharedPtr app = application_manager_.application(app_id); if (!app) { LOG4CXX_ERROR(logger_, "No application associated with session key"); @@ -261,8 +264,8 @@ bool AlertRequest::Validate(uint32_t app_id) { if (mobile_apis::HMILevel::HMI_BACKGROUND == app->hmi_level() && app->IsCommandLimitsExceeded( - static_cast<mobile_apis::FunctionID::eType>(function_id()), - application_manager::TLimitSource::POLICY_TABLE)) { + static_cast<mobile_apis::FunctionID::eType>(function_id()), + application_manager::TLimitSource::POLICY_TABLE)) { LOG4CXX_ERROR(logger_, "Alert frequency is too high."); SendResponse(false, mobile_apis::Result::REJECTED); return false; @@ -273,11 +276,13 @@ bool AlertRequest::Validate(uint32_t app_id) { return false; } - //ProcessSoftButtons checks strings on the contents incorrect character + // ProcessSoftButtons checks strings on the contents incorrect character mobile_apis::Result::eType processing_result = - MessageHelper::ProcessSoftButtons((*message_)[strings::msg_params], app, - application_manager_.GetPolicyHandler(), application_manager_); + MessageHelper::ProcessSoftButtons((*message_)[strings::msg_params], + app, + application_manager_.GetPolicyHandler(), + application_manager_); if (mobile_apis::Result::SUCCESS != processing_result) { LOG4CXX_ERROR(logger_, "INVALID_DATA!"); @@ -286,13 +291,13 @@ bool AlertRequest::Validate(uint32_t app_id) { } // check if mandatory params(alertText1 and TTSChunk) specified - if ((!(*message_)[strings::msg_params].keyExists(strings::alert_text1)) - && (!(*message_)[strings::msg_params].keyExists(strings::alert_text2)) - && (!(*message_)[strings::msg_params].keyExists(strings::tts_chunks) - && (1 > (*message_)[strings::msg_params] - [strings::tts_chunks].length()))) { + if ((!(*message_)[strings::msg_params].keyExists(strings::alert_text1)) && + (!(*message_)[strings::msg_params].keyExists(strings::alert_text2)) && + (!(*message_)[strings::msg_params].keyExists(strings::tts_chunks) && + (1 > (*message_)[strings::msg_params][strings::tts_chunks].length()))) { LOG4CXX_ERROR(logger_, "Mandatory parameters are missing"); - SendResponse(false, mobile_apis::Result::INVALID_DATA, + SendResponse(false, + mobile_apis::Result::INVALID_DATA, "Mandatory parameters are missing"); return false; } @@ -302,22 +307,21 @@ bool AlertRequest::Validate(uint32_t app_id) { void AlertRequest::SendAlertRequest(int32_t app_id) { LOG4CXX_AUTO_TRACE(logger_); - ApplicationSharedPtr app = - application_manager_.application(app_id); + ApplicationSharedPtr app = application_manager_.application(app_id); - smart_objects::SmartObject msg_params = smart_objects::SmartObject( - smart_objects::SmartType_Map); + smart_objects::SmartObject msg_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); - msg_params[hmi_request::alert_strings] = smart_objects::SmartObject( - smart_objects::SmartType_Array); + msg_params[hmi_request::alert_strings] = + smart_objects::SmartObject(smart_objects::SmartType_Array); int32_t index = 0; if ((*message_)[strings::msg_params].keyExists(strings::alert_text1)) { msg_params[hmi_request::alert_strings][index][hmi_request::field_name] = hmi_apis::Common_TextFieldName::alertText1; - msg_params[hmi_request::alert_strings][index][hmi_request::field_text] = - (*message_)[strings::msg_params][strings::alert_text1]; - index++; + msg_params[hmi_request::alert_strings][index][hmi_request::field_text] = + (*message_)[strings::msg_params][strings::alert_text1]; + index++; } if ((*message_)[strings::msg_params].keyExists(strings::alert_text2)) { msg_params[hmi_request::alert_strings][index][hmi_request::field_name] = @@ -330,7 +334,7 @@ void AlertRequest::SendAlertRequest(int32_t app_id) { msg_params[hmi_request::alert_strings][index][hmi_request::field_name] = hmi_apis::Common_TextFieldName::alertText3; msg_params[hmi_request::alert_strings][index][hmi_request::field_text] = - (*message_)[strings::msg_params][strings::alert_text3]; + (*message_)[strings::msg_params][strings::alert_text3]; } // softButtons @@ -347,7 +351,7 @@ void AlertRequest::SendAlertRequest(int32_t app_id) { // NAVI platform progressIndicator if ((*message_)[strings::msg_params].keyExists(strings::progress_indicator)) { msg_params[strings::progress_indicator] = - (*message_)[strings::msg_params][strings::progress_indicator]; + (*message_)[strings::msg_params][strings::progress_indicator]; } // PASA Alert type @@ -359,14 +363,14 @@ void AlertRequest::SendAlertRequest(int32_t app_id) { // check out if there are alert strings or soft buttons if (msg_params[hmi_request::alert_strings].length() > 0 || msg_params.keyExists(hmi_request::soft_buttons)) { - awaiting_ui_alert_response_ = true; is_ui_alert_sent_ = true; SendHMIRequest(hmi_apis::FunctionID::UI_Alert, &msg_params, true); } } -void AlertRequest::SendSpeakRequest(int32_t app_id, bool tts_chunks_exists, +void AlertRequest::SendSpeakRequest(int32_t app_id, + bool tts_chunks_exists, size_t length_tts_chunks) { LOG4CXX_AUTO_TRACE(logger_); using namespace hmi_apis; @@ -396,7 +400,7 @@ bool AlertRequest::CheckStringsOfAlertRequest() { str = (*message_)[strings::msg_params][strings::alert_text1].asCharArray(); if (!CheckSyntax(str)) { LOG4CXX_ERROR(logger_, "Invalid alert_text_1 syntax check failed"); - return false; + return false; } } @@ -404,7 +408,7 @@ bool AlertRequest::CheckStringsOfAlertRequest() { str = (*message_)[strings::msg_params][strings::alert_text2].asCharArray(); if (!CheckSyntax(str)) { LOG4CXX_ERROR(logger_, "Invalid alert_text_2 syntax check failed"); - return false; + return false; } } @@ -412,7 +416,7 @@ bool AlertRequest::CheckStringsOfAlertRequest() { str = (*message_)[strings::msg_params][strings::alert_text3].asCharArray(); if (!CheckSyntax(str)) { LOG4CXX_ERROR(logger_, "Invalid alert_text_3 syntax check failed"); - return false; + return false; } } @@ -432,8 +436,8 @@ bool AlertRequest::CheckStringsOfAlertRequest() { bool AlertRequest::HasHmiResponsesToWait() { LOG4CXX_AUTO_TRACE(logger_); - return awaiting_ui_alert_response_ || awaiting_tts_speak_response_ - || awaiting_tts_stop_speaking_response_; + return awaiting_ui_alert_response_ || awaiting_tts_speak_response_ || + awaiting_tts_stop_speaking_response_; } } // namespace commands diff --git a/src/components/application_manager/src/commands/mobile/alert_response.cc b/src/components/application_manager/src/commands/mobile/alert_response.cc index 5c7918731c..f8ca487eae 100644 --- a/src/components/application_manager/src/commands/mobile/alert_response.cc +++ b/src/components/application_manager/src/commands/mobile/alert_response.cc @@ -41,12 +41,11 @@ namespace application_manager { namespace commands { -AlertResponse::AlertResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} +AlertResponse::AlertResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : CommandResponseImpl(message, application_manager) {} -AlertResponse::~AlertResponse() { -} +AlertResponse::~AlertResponse() {} void AlertResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/change_registration_request.cc b/src/components/application_manager/src/commands/mobile/change_registration_request.cc index 84ce79611a..63339fdc33 100644 --- a/src/components/application_manager/src/commands/mobile/change_registration_request.cc +++ b/src/components/application_manager/src/commands/mobile/change_registration_request.cc @@ -42,16 +42,14 @@ namespace { namespace custom_str = utils::custom_string; struct IsSameNickname { - IsSameNickname(const custom_str::CustomString& app_id): - app_id_(app_id) { - } - bool operator()(const policy::StringArray::value_type& nickname) const { - return app_id_.CompareIgnoreCase(nickname.c_str()); - } + IsSameNickname(const custom_str::CustomString& app_id) : app_id_(app_id) {} + bool operator()(const policy::StringArray::value_type& nickname) const { + return app_id_.CompareIgnoreCase(nickname.c_str()); + } - private: - const custom_str::CustomString& app_id_; - }; + private: + const custom_str::CustomString& app_id_; +}; } namespace application_manager { @@ -60,20 +58,19 @@ namespace commands { ChangeRegistrationRequest::ChangeRegistrationRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager), - ui_result_(hmi_apis::Common_Result::INVALID_ENUM), - vr_result_(hmi_apis::Common_Result::INVALID_ENUM), - tts_result_(hmi_apis::Common_Result::INVALID_ENUM) { -} + : CommandRequestImpl(message, application_manager) + , ui_result_(hmi_apis::Common_Result::INVALID_ENUM) + , vr_result_(hmi_apis::Common_Result::INVALID_ENUM) + , tts_result_(hmi_apis::Common_Result::INVALID_ENUM) {} -ChangeRegistrationRequest::~ChangeRegistrationRequest() { -} +ChangeRegistrationRequest::~ChangeRegistrationRequest() {} void ChangeRegistrationRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); using namespace smart_objects; - const HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities(); + const HMICapabilities& hmi_capabilities = + application_manager_.hmi_capabilities(); ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { @@ -113,10 +110,9 @@ void ChangeRegistrationRequest::Run() { const int32_t language = msg_params[strings::language].asInt(); - if (false == - (IsLanguageSupportedByUI(hmi_language) && - IsLanguageSupportedByVR(language) && - IsLanguageSupportedByTTS(language))) { + if (false == (IsLanguageSupportedByUI(hmi_language) && + IsLanguageSupportedByVR(language) && + IsLanguageSupportedByTTS(language))) { LOG4CXX_ERROR(logger_, "Language is not supported"); SendResponse(false, mobile_apis::Result::REJECTED); return; @@ -146,11 +142,10 @@ void ChangeRegistrationRequest::Run() { ui_params[strings::ngn_media_screen_app_name] = msg_params[strings::ngn_media_screen_app_name]; app->set_ngn_media_screen_name( - msg_params[strings::ngn_media_screen_app_name]); + msg_params[strings::ngn_media_screen_app_name]); } - SendHMIRequest(hmi_apis::FunctionID::UI_ChangeRegistration, - &ui_params, true); + SendHMIRequest(hmi_apis::FunctionID::UI_ChangeRegistration, &ui_params, true); // VR processing SmartObject vr_params = SmartObject(SmartType_Map); @@ -160,10 +155,9 @@ void ChangeRegistrationRequest::Run() { vr_params[strings::app_id] = app->app_id(); if (msg_params.keyExists(strings::vr_synonyms)) { vr_params[strings::vr_synonyms] = msg_params[strings::vr_synonyms]; - app -> set_vr_synonyms(msg_params[strings::vr_synonyms]); + app->set_vr_synonyms(msg_params[strings::vr_synonyms]); } - SendHMIRequest(hmi_apis::FunctionID::VR_ChangeRegistration, - &vr_params, true); + SendHMIRequest(hmi_apis::FunctionID::VR_ChangeRegistration, &vr_params, true); // TTS processing SmartObject tts_params = SmartObject(SmartType_Map); @@ -176,19 +170,17 @@ void ChangeRegistrationRequest::Run() { app->set_tts_name(msg_params[strings::tts_name]); } - SendHMIRequest(hmi_apis::FunctionID::TTS_ChangeRegistration, - &tts_params, true); + SendHMIRequest( + hmi_apis::FunctionID::TTS_ChangeRegistration, &tts_params, true); } bool ChangeRegistrationRequest::AllHmiResponsesSuccess( - const hmi_apis::Common_Result::eType ui, - const hmi_apis::Common_Result::eType vr, - const hmi_apis::Common_Result::eType tts) { - - return - hmi_apis::Common_Result::SUCCESS == ui && - hmi_apis::Common_Result::SUCCESS == vr && - hmi_apis::Common_Result::SUCCESS == tts; + const hmi_apis::Common_Result::eType ui, + const hmi_apis::Common_Result::eType vr, + const hmi_apis::Common_Result::eType tts) { + return hmi_apis::Common_Result::SUCCESS == ui && + hmi_apis::Common_Result::SUCCESS == vr && + hmi_apis::Common_Result::SUCCESS == tts; } void ChangeRegistrationRequest::on_event(const event_engine::Event& event) { @@ -236,28 +228,30 @@ void ChangeRegistrationRequest::on_event(const event_engine::Event& event) { if (hmi_apis::Common_Result::SUCCESS == ui_result_) { application->set_ui_language(static_cast<mobile_api::Language::eType>( - (*message_)[strings::msg_params][strings::hmi_display_language].asInt())); + (*message_)[strings::msg_params][strings::hmi_display_language] + .asInt())); } - if (hmi_apis::Common_Result::SUCCESS == vr_result_ - || hmi_apis::Common_Result::SUCCESS == tts_result_) { + if (hmi_apis::Common_Result::SUCCESS == vr_result_ || + hmi_apis::Common_Result::SUCCESS == tts_result_) { application->set_language(static_cast<mobile_api::Language::eType>( (*message_)[strings::msg_params][strings::language].asInt())); } - int32_t greates_result_code = std::max(std::max(ui_result_, vr_result_), - tts_result_); + int32_t greates_result_code = + std::max(std::max(ui_result_, vr_result_), tts_result_); (*message_)[strings::params][strings::function_id] = - mobile_apis::FunctionID::eType::ChangeRegistrationID; + mobile_apis::FunctionID::eType::ChangeRegistrationID; SendResponse(AllHmiResponsesSuccess(ui_result_, vr_result_, tts_result_), static_cast<mobile_apis::Result::eType>(greates_result_code), - NULL, &(message[strings::msg_params])); + NULL, + &(message[strings::msg_params])); } else { LOG4CXX_INFO(logger_, - "There are some pending responses from HMI." - "ChangeRegistrationRequest still waiting."); + "There are some pending responses from HMI." + "ChangeRegistrationRequest still waiting."); } } @@ -357,10 +351,10 @@ bool ChangeRegistrationRequest::IsWhiteSpaceExist() { } } - if ((*message_)[strings::msg_params]. - keyExists(strings::ngn_media_screen_app_name)) { - str = (*message_)[strings::msg_params] - [strings::ngn_media_screen_app_name].asCharArray(); + if ((*message_)[strings::msg_params].keyExists( + strings::ngn_media_screen_app_name)) { + str = (*message_)[strings::msg_params][strings::ngn_media_screen_app_name] + .asCharArray(); if (!CheckSyntax(str)) { LOG4CXX_ERROR(logger_, "Invalid ngn_media_screen_app_name syntax check failed"); @@ -436,20 +430,19 @@ mobile_apis::Result::eType ChangeRegistrationRequest::CheckCoincidence() { return mobile_apis::Result::DUPLICATE_NAME; } } // end vr check - } // application for end + } // application for end return mobile_apis::Result::SUCCESS; } bool ChangeRegistrationRequest::IsNicknameAllowed( const custom_str::CustomString& app_name) const { LOG4CXX_AUTO_TRACE(logger_); - ApplicationSharedPtr app = - application_manager_. - application(connection_key()); + 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; } @@ -458,20 +451,20 @@ bool ChangeRegistrationRequest::IsNicknameAllowed( policy::StringArray app_nicknames; policy::StringArray app_hmi_types; - bool init_result = application_manager_.GetPolicyHandler() - .GetInitialAppData(policy_app_id, &app_nicknames, &app_hmi_types); + bool init_result = application_manager_.GetPolicyHandler().GetInitialAppData( + policy_app_id, &app_nicknames, &app_hmi_types); if (!init_result) { LOG4CXX_ERROR(logger_, "Error during getting of nickname list for application " - << policy_app_id); + << policy_app_id); return false; } if (!app_nicknames.empty()) { IsSameNickname compare(app_name); - policy::StringArray::const_iterator it = std::find_if( - app_nicknames.begin(), app_nicknames.end(), compare); + policy::StringArray::const_iterator it = + std::find_if(app_nicknames.begin(), app_nicknames.end(), compare); if (app_nicknames.end() == it) { LOG4CXX_WARN(logger_, "Application name was not found in nicknames list."); diff --git a/src/components/application_manager/src/commands/mobile/change_registration_response.cc b/src/components/application_manager/src/commands/mobile/change_registration_response.cc index 0c41534e73..210cae64c5 100644 --- a/src/components/application_manager/src/commands/mobile/change_registration_response.cc +++ b/src/components/application_manager/src/commands/mobile/change_registration_response.cc @@ -33,18 +33,15 @@ #include "application_manager/commands/mobile/change_registration_response.h" - namespace application_manager { namespace commands { ChangeRegistrationResponse::ChangeRegistrationResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} + : CommandResponseImpl(message, application_manager) {} -ChangeRegistrationResponse::~ChangeRegistrationResponse() { -} +ChangeRegistrationResponse::~ChangeRegistrationResponse() {} void ChangeRegistrationResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/create_interaction_choice_set_request.cc b/src/components/application_manager/src/commands/mobile/create_interaction_choice_set_request.cc index 8f2d531032..b602601f26 100644 --- a/src/components/application_manager/src/commands/mobile/create_interaction_choice_set_request.cc +++ b/src/components/application_manager/src/commands/mobile/create_interaction_choice_set_request.cc @@ -46,12 +46,11 @@ namespace application_manager { namespace commands { CreateInteractionChoiceSetRequest::CreateInteractionChoiceSetRequest( - const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager), - expected_chs_count_(0), - received_chs_count_(0), - error_from_hmi_(false) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : CommandRequestImpl(message, application_manager) + , expected_chs_count_(0) + , received_chs_count_(0) + , error_from_hmi_(false) {} CreateInteractionChoiceSetRequest::~CreateInteractionChoiceSetRequest() { LOG4CXX_AUTO_TRACE(logger_); @@ -60,8 +59,7 @@ CreateInteractionChoiceSetRequest::~CreateInteractionChoiceSetRequest() { void CreateInteractionChoiceSetRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); using namespace mobile_apis; - ApplicationSharedPtr app = application_manager_.application( - connection_key()); + ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { LOG4CXX_ERROR(logger_, "NULL pointer"); @@ -73,32 +71,37 @@ void CreateInteractionChoiceSetRequest::Run() { ++i) { Result::eType verification_result_image = Result::SUCCESS; Result::eType verification_result_secondary_image = Result::SUCCESS; - if ((*message_)[strings::msg_params] - [strings::choice_set][i].keyExists(strings::image)) { + if ((*message_)[strings::msg_params][strings::choice_set][i].keyExists( + strings::image)) { verification_result_image = MessageHelper::VerifyImage( - (*message_)[strings::msg_params][strings::choice_set] - [i][strings::image], app, application_manager_); + (*message_)[strings::msg_params][strings::choice_set][i] + [strings::image], + app, + application_manager_); } - if ((*message_)[strings::msg_params] - [strings::choice_set][i].keyExists(strings::secondary_image)) { + if ((*message_)[strings::msg_params][strings::choice_set][i].keyExists( + strings::secondary_image)) { verification_result_secondary_image = MessageHelper::VerifyImage( - (*message_)[strings::msg_params][strings::choice_set] - [i][strings::secondary_image], app, application_manager_); + (*message_)[strings::msg_params][strings::choice_set][i] + [strings::secondary_image], + app, + application_manager_); } if (verification_result_image == Result::INVALID_DATA || verification_result_secondary_image == Result::INVALID_DATA) { LOG4CXX_ERROR(logger_, "Image verification failed."); - SendResponse(false, Result::INVALID_DATA); + SendResponse(false, Result::INVALID_DATA); return; } } - choice_set_id_ = (*message_)[strings::msg_params] - [strings::interaction_choice_set_id].asInt(); + choice_set_id_ = + (*message_)[strings::msg_params][strings::interaction_choice_set_id] + .asInt(); if (app->FindChoiceSet(choice_set_id_)) { - LOG4CXX_ERROR(logger_, "Choice set with id " << choice_set_id_ << - " is not found."); + LOG4CXX_ERROR(logger_, + "Choice set with id " << choice_set_id_ << " is not found."); SendResponse(false, Result::INVALID_ID); return; } @@ -115,7 +118,7 @@ void CreateInteractionChoiceSetRequest::Run() { } mobile_apis::Result::eType CreateInteractionChoiceSetRequest::CheckChoiceSet( - ApplicationConstSharedPtr app) { + ApplicationConstSharedPtr app) { using namespace smart_objects; LOG4CXX_AUTO_TRACE(logger_); @@ -130,15 +133,15 @@ mobile_apis::Result::eType CreateInteractionChoiceSetRequest::CheckChoiceSet( std::pair<std::set<uint32_t>::iterator, bool> ins_res = choice_id_set.insert((*choice_set_it)[strings::choice_id].asInt()); if (!ins_res.second) { - LOG4CXX_ERROR(logger_, "Choise with ID " - << (*choice_set_it)[strings::choice_id].asInt() - << " already exists"); + LOG4CXX_ERROR(logger_, + "Choise with ID " + << (*choice_set_it)[strings::choice_id].asInt() + << " already exists"); return mobile_apis::Result::INVALID_ID; } if (IsWhiteSpaceExist(*choice_set_it)) { - LOG4CXX_ERROR(logger_, - "Incoming choice set has contains \t\n \\t \\n"); + LOG4CXX_ERROR(logger_, "Incoming choice set has contains \t\n \\t \\n"); return mobile_apis::Result::INVALID_DATA; } } @@ -146,24 +149,26 @@ mobile_apis::Result::eType CreateInteractionChoiceSetRequest::CheckChoiceSet( } bool CreateInteractionChoiceSetRequest::compareSynonyms( - const NsSmartDeviceLink::NsSmartObjects::SmartObject& choice1, - const NsSmartDeviceLink::NsSmartObjects::SmartObject& choice2) { + const NsSmartDeviceLink::NsSmartObjects::SmartObject& choice1, + const NsSmartDeviceLink::NsSmartObjects::SmartObject& choice2) { smart_objects::SmartArray* vr_cmds_1 = - choice1[strings::vr_commands].asArray(); + choice1[strings::vr_commands].asArray(); DCHECK(vr_cmds_1 != NULL); smart_objects::SmartArray* vr_cmds_2 = - choice2[strings::vr_commands].asArray(); + choice2[strings::vr_commands].asArray(); DCHECK(vr_cmds_2 != NULL); smart_objects::SmartArray::iterator it; - it = std::find_first_of(vr_cmds_1->begin(), vr_cmds_1->end(), - vr_cmds_2->begin(), vr_cmds_2->end(), + it = std::find_first_of(vr_cmds_1->begin(), + vr_cmds_1->end(), + vr_cmds_2->begin(), + vr_cmds_2->end(), 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; } @@ -171,13 +176,13 @@ bool CreateInteractionChoiceSetRequest::compareSynonyms( } bool CreateInteractionChoiceSetRequest::compareStr( - const NsSmartDeviceLink::NsSmartObjects::SmartObject& str1, - const NsSmartDeviceLink::NsSmartObjects::SmartObject& str2) { + const NsSmartDeviceLink::NsSmartObjects::SmartObject& str1, + const NsSmartDeviceLink::NsSmartObjects::SmartObject& str2) { return 0 == strcasecmp(str1.asCharArray(), str2.asCharArray()); } bool CreateInteractionChoiceSetRequest::IsWhiteSpaceExist( - const smart_objects::SmartObject& choice_set) { + const smart_objects::SmartObject& choice_set) { LOG4CXX_AUTO_TRACE(logger_); const char* str = NULL; @@ -204,8 +209,7 @@ bool CreateInteractionChoiceSetRequest::IsWhiteSpaceExist( } if (choice_set.keyExists(strings::vr_commands)) { - const size_t len = - choice_set[strings::vr_commands].length(); + const size_t len = choice_set[strings::vr_commands].length(); for (size_t i = 0; i < len; ++i) { str = choice_set[strings::vr_commands][i].asCharArray(); @@ -227,8 +231,9 @@ bool CreateInteractionChoiceSetRequest::IsWhiteSpaceExist( if (choice_set.keyExists(strings::secondary_image)) { str = choice_set[strings::secondary_image][strings::value].asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid secondary_image value. " - "Syntax check failed"); + LOG4CXX_ERROR(logger_, + "Invalid secondary_image value. " + "Syntax check failed"); return true; } } @@ -236,15 +241,15 @@ bool CreateInteractionChoiceSetRequest::IsWhiteSpaceExist( } void CreateInteractionChoiceSetRequest::SendVRAddCommandRequests( - application_manager::ApplicationSharedPtr const app) { + application_manager::ApplicationSharedPtr const app) { LOG4CXX_AUTO_TRACE(logger_); smart_objects::SmartObject& choice_set = (*message_)[strings::msg_params]; - smart_objects::SmartObject msg_params = smart_objects::SmartObject( - smart_objects::SmartType_Map); + smart_objects::SmartObject msg_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); msg_params[strings::type] = hmi_apis::Common_VRCommandType::Choice; msg_params[strings::app_id] = app->app_id(); - msg_params[strings::grammar_id] = choice_set[strings::grammar_id]; + msg_params[strings::grammar_id] = choice_set[strings::grammar_id]; const uint32_t choice_count = choice_set[strings::choice_set].length(); SetAllowedToTerminate(false); @@ -254,17 +259,18 @@ void CreateInteractionChoiceSetRequest::SendVRAddCommandRequests( { sync_primitives::AutoLock error_lock(error_from_hmi_lock_); if (error_from_hmi_) { - LOG4CXX_WARN(logger_, "Error from HMI received. Stop sending VRCommands"); + LOG4CXX_WARN(logger_, + "Error from HMI received. Stop sending VRCommands"); break; } } msg_params[strings::cmd_id] = - choice_set[strings::choice_set][chs_num][strings::choice_id]; - msg_params[strings::vr_commands] = smart_objects::SmartObject( - smart_objects::SmartType_Array); + choice_set[strings::choice_set][chs_num][strings::choice_id]; + msg_params[strings::vr_commands] = + smart_objects::SmartObject(smart_objects::SmartType_Array); msg_params[strings::vr_commands] = - choice_set[strings::choice_set][chs_num][strings::vr_commands]; + choice_set[strings::choice_set][chs_num][strings::vr_commands]; sync_primitives::AutoLock commands_lock(vr_commands_lock_); const uint32_t vr_cmd_id = msg_params[strings::cmd_id].asUInt(); @@ -273,8 +279,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_); @@ -289,12 +296,13 @@ void CreateInteractionChoiceSetRequest::on_event( const smart_objects::SmartObject& message = event.smart_object(); if (event.id() == hmi_apis::FunctionID::VR_AddCommand) { received_chs_count_++; - LOG4CXX_DEBUG(logger_, "Got VR.AddCommand response, there are " - << expected_chs_count_ - received_chs_count_ - << " more to wait."); + LOG4CXX_DEBUG(logger_, + "Got VR.AddCommand response, there are " + << expected_chs_count_ - received_chs_count_ + << " more to wait."); - uint32_t corr_id = static_cast<uint32_t>(message[strings::params] - [strings::correlation_id].asUInt()); + uint32_t corr_id = static_cast<uint32_t>( + message[strings::params][strings::correlation_id].asUInt()); { sync_primitives::AutoLock commands_lock(vr_commands_lock_); SentCommandsMap::iterator it = sent_commands_map_.find(corr_id); @@ -303,21 +311,20 @@ void CreateInteractionChoiceSetRequest::on_event( return; } - Common_Result::eType vr_result = static_cast<Common_Result::eType>( - message[strings::params][hmi_response::code].asInt()); + Common_Result::eType vr_result = static_cast<Common_Result::eType>( + message[strings::params][hmi_response::code].asInt()); - const bool is_vr_no_error = - Compare<Common_Result::eType, EQ, ONE>( - vr_result, - Common_Result::SUCCESS, - Common_Result::WARNINGS); + const bool is_vr_no_error = Compare<Common_Result::eType, EQ, ONE>( + vr_result, Common_Result::SUCCESS, Common_Result::WARNINGS); if (is_vr_no_error) { VRCommandInfo& vr_command = it->second; vr_command.succesful_response_received_ = true; } else { - LOG4CXX_DEBUG(logger_, "Hmi response is not Success: " << vr_result - << ". Stop sending VRAddCommand requests"); + LOG4CXX_DEBUG(logger_, + "Hmi response is not Success: " + << vr_result + << ". Stop sending VRAddCommand requests"); if (!error_from_hmi_) { error_from_hmi_ = true; SendResponse(false, GetMobileResultCode(vr_result)); @@ -346,15 +353,14 @@ void CreateInteractionChoiceSetRequest::onTimeOut() { // according to SDLAQ-CRS-2976 sync_primitives::AutoLock timeout_lock_(is_timed_out_lock_); is_timed_out_ = true; - application_manager_.TerminateRequest( - connection_key(), correlation_id()); + application_manager_.TerminateRequest(connection_key(), correlation_id()); } void CreateInteractionChoiceSetRequest::DeleteChoices() { LOG4CXX_AUTO_TRACE(logger_); ApplicationSharedPtr application = - application_manager_.application(connection_key()); + application_manager_.application(connection_key()); if (!application) { LOG4CXX_ERROR(logger_, "NULL pointer"); return; @@ -372,9 +378,9 @@ void CreateInteractionChoiceSetRequest::DeleteChoices() { msg_param[strings::cmd_id] = vr_command_info.cmd_id_; SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_param); } else { - LOG4CXX_WARN( - logger_, "Succesfull response has not been received for cmd_id = " - << vr_command_info.cmd_id_); + LOG4CXX_WARN(logger_, + "Succesfull response has not been received for cmd_id = " + << vr_command_info.cmd_id_); } } sent_commands_map_.clear(); @@ -397,8 +403,7 @@ void CreateInteractionChoiceSetRequest::OnAllHMIResponsesReceived() { DeleteChoices(); } - application_manager_.TerminateRequest( - connection_key(), correlation_id()); + application_manager_.TerminateRequest(connection_key(), correlation_id()); } } // namespace commands diff --git a/src/components/application_manager/src/commands/mobile/create_interaction_choice_set_response.cc b/src/components/application_manager/src/commands/mobile/create_interaction_choice_set_response.cc index cac23a4bc9..0cc137d6a0 100644 --- a/src/components/application_manager/src/commands/mobile/create_interaction_choice_set_response.cc +++ b/src/components/application_manager/src/commands/mobile/create_interaction_choice_set_response.cc @@ -42,11 +42,9 @@ namespace commands { CreateInteractionChoiceSetResponse::CreateInteractionChoiceSetResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} + : CommandResponseImpl(message, application_manager) {} -CreateInteractionChoiceSetResponse::~CreateInteractionChoiceSetResponse() { -} +CreateInteractionChoiceSetResponse::~CreateInteractionChoiceSetResponse() {} void CreateInteractionChoiceSetResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/delete_command_request.cc b/src/components/application_manager/src/commands/mobile/delete_command_request.cc index baebbe26cd..9a7b92f7b8 100644 --- a/src/components/application_manager/src/commands/mobile/delete_command_request.cc +++ b/src/components/application_manager/src/commands/mobile/delete_command_request.cc @@ -43,24 +43,23 @@ namespace application_manager { namespace commands { -DeleteCommandRequest::DeleteCommandRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager), - is_ui_send_(false), - is_vr_send_(false), - is_ui_received_(false), - is_vr_received_(false), - ui_result_(hmi_apis::Common_Result::INVALID_ENUM), - vr_result_(hmi_apis::Common_Result::INVALID_ENUM) { -} - -DeleteCommandRequest::~DeleteCommandRequest() { -} +DeleteCommandRequest::DeleteCommandRequest( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : CommandRequestImpl(message, application_manager) + , is_ui_send_(false) + , is_vr_send_(false) + , is_ui_received_(false) + , is_vr_received_(false) + , ui_result_(hmi_apis::Common_Result::INVALID_ENUM) + , vr_result_(hmi_apis::Common_Result::INVALID_ENUM) {} + +DeleteCommandRequest::~DeleteCommandRequest() {} void DeleteCommandRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); - ApplicationSharedPtr application = application_manager_. - application(connection_key()); + ApplicationSharedPtr application = + application_manager_.application(connection_key()); if (!application) { LOG4CXX_ERROR(logger_, "Application is not registered"); @@ -79,8 +78,8 @@ void DeleteCommandRequest::Run() { return; } - smart_objects::SmartObject msg_params = smart_objects::SmartObject( - smart_objects::SmartType_Map); + smart_objects::SmartObject msg_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); msg_params[strings::cmd_id] = (*message_)[strings::msg_params][strings::cmd_id]; @@ -123,20 +122,22 @@ void DeleteCommandRequest::on_event(const event_engine::Event& event) { is_ui_received_ = true; const int result = message[strings::params][hmi_response::code].asInt(); ui_result_ = static_cast<hmi_apis::Common_Result::eType>(result); - LOG4CXX_DEBUG(logger_, "Received UI_DeleteCommand event with result " - << MessageHelper::HMIResultToString(ui_result_)); + LOG4CXX_DEBUG(logger_, + "Received UI_DeleteCommand event with result " + << MessageHelper::HMIResultToString(ui_result_)); break; } case hmi_apis::FunctionID::VR_DeleteCommand: { is_vr_received_ = true; const int result = message[strings::params][hmi_response::code].asInt(); vr_result_ = static_cast<hmi_apis::Common_Result::eType>(result); - LOG4CXX_DEBUG(logger_, "Received VR_DeleteCommand event with result " - << MessageHelper::HMIResultToString(vr_result_)); + LOG4CXX_DEBUG(logger_, + "Received VR_DeleteCommand event with result " + << MessageHelper::HMIResultToString(vr_result_)); break; } default: { - LOG4CXX_ERROR(logger_,"Received unknown event" << event.id()); + LOG4CXX_ERROR(logger_, "Received unknown event" << event.id()); return; } } @@ -160,34 +161,32 @@ void DeleteCommandRequest::on_event(const event_engine::Event& event) { smart_objects::SmartObject* command = application->FindCommand(cmd_id); if (!command) { - LOG4CXX_ERROR(logger_, "Command id " << cmd_id << " not found for " - "application with connection key " << connection_key()); + LOG4CXX_ERROR(logger_, + "Command id " << cmd_id << " not found for " + "application with connection key " + << connection_key()); return; } const bool is_vr_success_invalid = Compare<hmi_apis::Common_Result::eType, EQ, ONE>( - vr_result_, - hmi_apis::Common_Result::SUCCESS, - hmi_apis::Common_Result::INVALID_ENUM); + vr_result_, + hmi_apis::Common_Result::SUCCESS, + hmi_apis::Common_Result::INVALID_ENUM); const bool is_ui_success_invalid = Compare<hmi_apis::Common_Result::eType, EQ, ONE>( - ui_result_, - hmi_apis::Common_Result::SUCCESS, - hmi_apis::Common_Result::INVALID_ENUM); + ui_result_, + hmi_apis::Common_Result::SUCCESS, + hmi_apis::Common_Result::INVALID_ENUM); const bool is_vr_ui_invalid = Compare<hmi_apis::Common_Result::eType, EQ, ALL>( - hmi_apis::Common_Result::INVALID_ENUM, - vr_result_, - ui_result_); + hmi_apis::Common_Result::INVALID_ENUM, vr_result_, ui_result_); const bool is_vr_or_ui_warning = Compare<hmi_apis::Common_Result::eType, EQ, ONE>( - hmi_apis::Common_Result::WARNINGS, - ui_result_, - vr_result_); + hmi_apis::Common_Result::WARNINGS, ui_result_, vr_result_); const bool result = // In case of UI/VR is SUCCESS and other is SUCCESS/INVALID_ENUM @@ -202,15 +201,14 @@ void DeleteCommandRequest::on_event(const event_engine::Event& event) { } mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM; - if (!result && - hmi_apis::Common_Result::REJECTED == ui_result_) { + if (!result && hmi_apis::Common_Result::REJECTED == ui_result_) { result_code = MessageHelper::HMIToMobileResult(vr_result_); } else if (is_vr_or_ui_warning) { LOG4CXX_DEBUG(logger_, "VR or UI result is warning"); result_code = mobile_apis::Result::WARNINGS; } else { - result_code = MessageHelper::HMIToMobileResult( - std::max(ui_result_, vr_result_)); + result_code = + MessageHelper::HMIToMobileResult(std::max(ui_result_, vr_result_)); } SendResponse(result, result_code, NULL, &msg_params); diff --git a/src/components/application_manager/src/commands/mobile/delete_command_response.cc b/src/components/application_manager/src/commands/mobile/delete_command_response.cc index c1ab1926e2..7abc1c11d4 100644 --- a/src/components/application_manager/src/commands/mobile/delete_command_response.cc +++ b/src/components/application_manager/src/commands/mobile/delete_command_response.cc @@ -33,17 +33,15 @@ #include "application_manager/commands/mobile/delete_command_response.h" - namespace application_manager { namespace commands { -DeleteCommandResponse::DeleteCommandResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} +DeleteCommandResponse::DeleteCommandResponse( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : CommandResponseImpl(message, application_manager) {} -DeleteCommandResponse::~DeleteCommandResponse() { -} +DeleteCommandResponse::~DeleteCommandResponse() {} void DeleteCommandResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/delete_file_request.cc b/src/components/application_manager/src/commands/mobile/delete_file_request.cc index adc4dbb776..00d23bb094 100644 --- a/src/components/application_manager/src/commands/mobile/delete_file_request.cc +++ b/src/components/application_manager/src/commands/mobile/delete_file_request.cc @@ -41,12 +41,11 @@ namespace application_manager { namespace commands { -DeleteFileRequest::DeleteFileRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager) { -} +DeleteFileRequest::DeleteFileRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : CommandRequestImpl(message, application_manager) {} -DeleteFileRequest::~DeleteFileRequest() { -} +DeleteFileRequest::~DeleteFileRequest() {} void DeleteFileRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -63,11 +62,12 @@ void DeleteFileRequest::Run() { if ((mobile_api::HMILevel::HMI_NONE == application->hmi_level()) && (application_manager_.get_settings().delete_file_in_none() <= application->delete_file_in_none_count())) { - // If application is in the HMI_NONE level the quantity of allowed - // DeleteFile request is limited by the configuration profile - LOG4CXX_ERROR(logger_, "Too many requests from the app with HMILevel HMI_NONE "); - SendResponse(false, mobile_apis::Result::REJECTED); - return; + // If application is in the HMI_NONE level the quantity of allowed + // DeleteFile request is limited by the configuration profile + LOG4CXX_ERROR(logger_, + "Too many requests from the app with HMILevel HMI_NONE "); + SendResponse(false, mobile_apis::Result::REJECTED); + return; } const std::string& sync_file_name = @@ -97,17 +97,16 @@ void DeleteFileRequest::Run() { } } -void DeleteFileRequest::SendFileRemovedNotification( - const AppFile* file) const { - smart_objects::SmartObject msg_params = smart_objects::SmartObject( - smart_objects::SmartType_Map); +void DeleteFileRequest::SendFileRemovedNotification(const AppFile* file) const { + smart_objects::SmartObject msg_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); - msg_params[strings::app_id] = connection_key(); - msg_params[strings::file_name] = file->file_name; - msg_params[strings::file_type] = file->file_type; + msg_params[strings::app_id] = connection_key(); + msg_params[strings::file_name] = file->file_name; + msg_params[strings::file_type] = file->file_type; - CreateHMINotification( - hmi_apis::FunctionID::BasicCommunication_OnFileRemoved, msg_params); + CreateHMINotification(hmi_apis::FunctionID::BasicCommunication_OnFileRemoved, + msg_params); } } // namespace commands diff --git a/src/components/application_manager/src/commands/mobile/delete_file_response.cc b/src/components/application_manager/src/commands/mobile/delete_file_response.cc index f9fbd93fa2..8ed6f7ba2e 100644 --- a/src/components/application_manager/src/commands/mobile/delete_file_response.cc +++ b/src/components/application_manager/src/commands/mobile/delete_file_response.cc @@ -39,19 +39,17 @@ namespace application_manager { namespace commands { -DeleteFileResponse::DeleteFileResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} +DeleteFileResponse::DeleteFileResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : CommandResponseImpl(message, application_manager) {} -DeleteFileResponse::~DeleteFileResponse() { -} +DeleteFileResponse::~DeleteFileResponse() {} void DeleteFileResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); - uint32_t app_id = (*message_)[strings::params][strings::connection_key] - .asUInt(); - ApplicationSharedPtr app = - application_manager_.application(app_id); + uint32_t app_id = + (*message_)[strings::params][strings::connection_key].asUInt(); + ApplicationSharedPtr app = application_manager_.application(app_id); if (!app) { LOG4CXX_ERROR(logger_, "Application not registered"); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); diff --git a/src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_request.cc b/src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_request.cc index 1a5aa490bb..6ef8e5d9da 100644 --- a/src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_request.cc +++ b/src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_request.cc @@ -44,32 +44,30 @@ namespace commands { DeleteInteractionChoiceSetRequest::DeleteInteractionChoiceSetRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager) { -} + : CommandRequestImpl(message, application_manager) {} -DeleteInteractionChoiceSetRequest::~DeleteInteractionChoiceSetRequest() { -} +DeleteInteractionChoiceSetRequest::~DeleteInteractionChoiceSetRequest() {} void DeleteInteractionChoiceSetRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); - ApplicationSharedPtr app = - application_manager_.application(connection_key()); + 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; } const int32_t choice_set_id = - (*message_)[strings::msg_params] - [strings::interaction_choice_set_id].asInt(); + (*message_)[strings::msg_params][strings::interaction_choice_set_id] + .asInt(); if (!app->FindChoiceSet(choice_set_id)) { - LOG4CXX_ERROR(logger_, "Choice set with id " << choice_set_id - << " is not found."); + LOG4CXX_ERROR(logger_, + "Choice set with id " << choice_set_id << " is not found."); SendResponse(false, mobile_apis::Result::INVALID_ID); return; } @@ -81,8 +79,8 @@ void DeleteInteractionChoiceSetRequest::Run() { } SendVrDeleteCommand(app); - smart_objects::SmartObject msg_params = smart_objects::SmartObject( - smart_objects::SmartType_Map); + smart_objects::SmartObject msg_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); msg_params[strings::interaction_choice_set_id] = choice_set_id; msg_params[strings::app_id] = app->app_id(); @@ -108,17 +106,17 @@ bool DeleteInteractionChoiceSetRequest::ChoiceSetInUse( const PerformChoiceSetMap& choice_set_map = accessor.GetData(); const uint32_t choice_set_id = - (*message_)[strings::msg_params][strings::interaction_choice_set_id]. - asUInt(); + (*message_)[strings::msg_params][strings::interaction_choice_set_id] + .asUInt(); PerformChoiceSetMap::const_iterator it = choice_set_map.begin(); for (; choice_set_map.end() != it; ++it) { - const PerformChoice& choice = it->second; + const PerformChoice& choice = it->second; PerformChoice::const_iterator choice_it = choice.begin(); for (; choice.end() != choice_it; ++choice_it) { if (choice_it->first == choice_set_id) { - LOG4CXX_ERROR(logger_, "Choice set with id " << choice_set_id - << " is in use."); + LOG4CXX_ERROR(logger_, + "Choice set with id " << choice_set_id << " is in use."); return true; } } @@ -131,24 +129,24 @@ void DeleteInteractionChoiceSetRequest::SendVrDeleteCommand( LOG4CXX_AUTO_TRACE(logger_); const uint32_t choice_set_id = - (*message_)[strings::msg_params][strings::interaction_choice_set_id]. - asUInt(); + (*message_)[strings::msg_params][strings::interaction_choice_set_id] + .asUInt(); smart_objects::SmartObject* choice_set = app->FindChoiceSet(choice_set_id); if (!choice_set) { - LOG4CXX_ERROR(logger_, "Choice set with id " << choice_set_id - << " is not found."); + LOG4CXX_ERROR(logger_, + "Choice set with id " << choice_set_id << " is not found."); return; } - smart_objects::SmartObject msg_params = smart_objects::SmartObject( - smart_objects::SmartType_Map); + smart_objects::SmartObject msg_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); msg_params[strings::app_id] = app->app_id(); msg_params[strings::type] = hmi_apis::Common_VRCommandType::Choice; msg_params[strings::grammar_id] = (*choice_set)[strings::grammar_id]; choice_set = &((*choice_set)[strings::choice_set]); - for (uint32_t i = 0; i < (*choice_set).length() ; ++i) { + for (uint32_t i = 0; i < (*choice_set).length(); ++i) { msg_params[strings::cmd_id] = (*choice_set)[i][strings::choice_id]; SendHMIRequest(hmi_apis::FunctionID::VR_DeleteCommand, &msg_params); } diff --git a/src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_response.cc b/src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_response.cc index 1281cddf6a..97e07529af 100644 --- a/src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_response.cc +++ b/src/components/application_manager/src/commands/mobile/delete_interaction_choice_set_response.cc @@ -43,11 +43,9 @@ namespace commands { DeleteInteractionChoiceSetResponse::DeleteInteractionChoiceSetResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} + : CommandResponseImpl(message, application_manager) {} -DeleteInteractionChoiceSetResponse::~DeleteInteractionChoiceSetResponse() { -} +DeleteInteractionChoiceSetResponse::~DeleteInteractionChoiceSetResponse() {} void DeleteInteractionChoiceSetResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/delete_sub_menu_request.cc b/src/components/application_manager/src/commands/mobile/delete_sub_menu_request.cc index ea19cb3389..bdb5521921 100644 --- a/src/components/application_manager/src/commands/mobile/delete_sub_menu_request.cc +++ b/src/components/application_manager/src/commands/mobile/delete_sub_menu_request.cc @@ -41,18 +41,16 @@ namespace application_manager { namespace commands { -DeleteSubMenuRequest::DeleteSubMenuRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager) { -} +DeleteSubMenuRequest::DeleteSubMenuRequest( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : CommandRequestImpl(message, application_manager) {} -DeleteSubMenuRequest::~DeleteSubMenuRequest() { -} +DeleteSubMenuRequest::~DeleteSubMenuRequest() {} void DeleteSubMenuRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); - ApplicationSharedPtr app = - application_manager_.application(connection_key()); + ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); @@ -69,8 +67,8 @@ void DeleteSubMenuRequest::Run() { return; } - smart_objects::SmartObject msg_params = smart_objects::SmartObject( - smart_objects::SmartType_Map); + smart_objects::SmartObject msg_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); msg_params[strings::menu_id] = (*message_)[strings::msg_params][strings::menu_id]; @@ -88,16 +86,14 @@ void DeleteSubMenuRequest::DeleteSubMenuVRCommands( CommandsMap::const_iterator it = commands.begin(); for (; commands.end() != it; ++it) { - if (!(*it->second).keyExists(strings::vr_commands)) { continue; } - if ((*message_)[strings::msg_params][strings::menu_id].asInt() - == (*it->second)[strings::menu_params] - [hmi_request::parent_id].asInt()) { - smart_objects::SmartObject msg_params = smart_objects::SmartObject( - smart_objects::SmartType_Map); + if ((*message_)[strings::msg_params][strings::menu_id].asInt() == + (*it->second)[strings::menu_params][hmi_request::parent_id].asInt()) { + smart_objects::SmartObject msg_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); msg_params[strings::cmd_id] = (*it->second)[strings::cmd_id].asInt(); msg_params[strings::app_id] = app->app_id(); msg_params[strings::grammar_id] = app->get_grammar_id(); @@ -123,11 +119,10 @@ void DeleteSubMenuRequest::DeleteSubMenuUICommands( continue; } - if ((*message_)[strings::msg_params][strings::menu_id].asInt() - == (*it->second)[strings::menu_params] - [hmi_request::parent_id].asInt()) { - smart_objects::SmartObject msg_params = smart_objects::SmartObject( - smart_objects::SmartType_Map); + if ((*message_)[strings::msg_params][strings::menu_id].asInt() == + (*it->second)[strings::menu_params][hmi_request::parent_id].asInt()) { + smart_objects::SmartObject msg_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); msg_params[strings::app_id] = app->app_id(); msg_params[strings::cmd_id] = (*it->second)[strings::cmd_id].asInt(); app->RemoveCommand((*it->second)[strings::cmd_id].asInt()); @@ -152,14 +147,13 @@ void DeleteSubMenuRequest::on_event(const event_engine::Event& event) { static_cast<mobile_apis::Result::eType>( message[strings::params][hmi_response::code].asInt()); - const bool result = - Compare<mobile_api::Result::eType, EQ, ONE>( - result_code, - mobile_api::Result::SUCCESS, - mobile_api::Result::WARNINGS); + const bool result = Compare<mobile_api::Result::eType, EQ, ONE>( + result_code, + mobile_api::Result::SUCCESS, + mobile_api::Result::WARNINGS); ApplicationSharedPtr application = - application_manager_.application(connection_key()); + application_manager_.application(connection_key()); if (!application) { LOG4CXX_ERROR(logger_, "NULL pointer"); @@ -172,7 +166,7 @@ void DeleteSubMenuRequest::on_event(const event_engine::Event& event) { DeleteSubMenuUICommands(application); application->RemoveSubMenu( (*message_)[strings::msg_params][strings::menu_id].asInt()); - } + } SendResponse(result, result_code, NULL, &(message[strings::msg_params])); if (result) { @@ -187,7 +181,6 @@ void DeleteSubMenuRequest::on_event(const event_engine::Event& event) { } } - } // namespace commands } // namespace application_manager diff --git a/src/components/application_manager/src/commands/mobile/delete_sub_menu_response.cc b/src/components/application_manager/src/commands/mobile/delete_sub_menu_response.cc index cea087024c..ad9d2ad858 100644 --- a/src/components/application_manager/src/commands/mobile/delete_sub_menu_response.cc +++ b/src/components/application_manager/src/commands/mobile/delete_sub_menu_response.cc @@ -33,17 +33,15 @@ #include "application_manager/commands/mobile/delete_sub_menu_response.h" - namespace application_manager { namespace commands { -DeleteSubMenuResponse::DeleteSubMenuResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} +DeleteSubMenuResponse::DeleteSubMenuResponse( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : CommandResponseImpl(message, application_manager) {} -DeleteSubMenuResponse::~DeleteSubMenuResponse() { -} +DeleteSubMenuResponse::~DeleteSubMenuResponse() {} void DeleteSubMenuResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/diagnostic_message_request.cc b/src/components/application_manager/src/commands/mobile/diagnostic_message_request.cc index 448c006793..5252ea0e33 100644 --- a/src/components/application_manager/src/commands/mobile/diagnostic_message_request.cc +++ b/src/components/application_manager/src/commands/mobile/diagnostic_message_request.cc @@ -42,18 +42,16 @@ namespace application_manager { namespace commands { -DiagnosticMessageRequest::DiagnosticMessageRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager) { -} +DiagnosticMessageRequest::DiagnosticMessageRequest( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : CommandRequestImpl(message, application_manager) {} -DiagnosticMessageRequest::~DiagnosticMessageRequest() { -} +DiagnosticMessageRequest::~DiagnosticMessageRequest() {} void DiagnosticMessageRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); - ApplicationSharedPtr app = - application_manager_.application(connection_key()); + ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { LOG4CXX_ERROR(logger_, "Application is not registered."); @@ -72,9 +70,11 @@ void DiagnosticMessageRequest::Run() { if (supported_diag_modes.end() == std::find(supported_diag_modes.begin(), supported_diag_modes.end(), msg_diagnostic_mode)) { - LOG4CXX_ERROR(logger_, "Received diagnostic mode " << msg_diagnostic_mode << - " is not supported."); - SendResponse(false, mobile_apis::Result::REJECTED, + LOG4CXX_ERROR(logger_, + "Received diagnostic mode " << msg_diagnostic_mode + << " is not supported."); + SendResponse(false, + mobile_apis::Result::REJECTED, "Received diagnostic mode is not supported."); return; } @@ -83,8 +83,8 @@ void DiagnosticMessageRequest::Run() { (*message_)[strings::msg_params][strings::app_id] = app->app_id(); SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage, - &(*message_)[strings::msg_params], true); - + &(*message_)[strings::msg_params], + true); } void DiagnosticMessageRequest::on_event(const event_engine::Event& event) { diff --git a/src/components/application_manager/src/commands/mobile/diagnostic_message_response.cc b/src/components/application_manager/src/commands/mobile/diagnostic_message_response.cc index ce987c9592..8c59a97a8b 100644 --- a/src/components/application_manager/src/commands/mobile/diagnostic_message_response.cc +++ b/src/components/application_manager/src/commands/mobile/diagnostic_message_response.cc @@ -33,17 +33,15 @@ #include "application_manager/commands/mobile/diagnostic_message_response.h" - namespace application_manager { namespace commands { -DiagnosticMessageResponse::DiagnosticMessageResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} +DiagnosticMessageResponse::DiagnosticMessageResponse( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : CommandResponseImpl(message, application_manager) {} -DiagnosticMessageResponse::~DiagnosticMessageResponse() { -} +DiagnosticMessageResponse::~DiagnosticMessageResponse() {} void DiagnosticMessageResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/dial_number_request.cc b/src/components/application_manager/src/commands/mobile/dial_number_request.cc index 52b6b7aaeb..64685afe2e 100644 --- a/src/components/application_manager/src/commands/mobile/dial_number_request.cc +++ b/src/components/application_manager/src/commands/mobile/dial_number_request.cc @@ -40,12 +40,11 @@ namespace application_manager { namespace commands { -DialNumberRequest::DialNumberRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager) { -} +DialNumberRequest::DialNumberRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : CommandRequestImpl(message, application_manager) {} -DialNumberRequest::~DialNumberRequest() { -} +DialNumberRequest::~DialNumberRequest() {} bool DialNumberRequest::Init() { LOG4CXX_AUTO_TRACE(logger_); @@ -77,7 +76,8 @@ void DialNumberRequest::Run() { StripNumberParam(number); if (number.empty()) { - LOG4CXX_ERROR(logger_, "After strip number param is empty. Invalid incoming data"); + LOG4CXX_ERROR(logger_, + "After strip number param is empty. Invalid incoming data"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } @@ -87,8 +87,8 @@ void DialNumberRequest::Run() { (*message_)[strings::msg_params][strings::number].asString(); msg_params[strings::app_id] = application->hmi_app_id(); - SendHMIRequest(hmi_apis::FunctionID::BasicCommunication_DialNumber, - &msg_params, true); + SendHMIRequest( + hmi_apis::FunctionID::BasicCommunication_DialNumber, &msg_params, true); } void DialNumberRequest::on_event(const event_engine::Event& event) { @@ -106,9 +106,9 @@ void DialNumberRequest::on_event(const event_engine::Event& event) { switch (event.id()) { case hmi_apis::FunctionID::BasicCommunication_DialNumber: { LOG4CXX_INFO(logger_, "Received DialNumber event"); - result_code = CommandRequestImpl::GetMobileResultCode( - static_cast<hmi_apis::Common_Result::eType>( - message[strings::params][hmi_response::code].asInt())); + result_code = CommandRequestImpl::GetMobileResultCode( + static_cast<hmi_apis::Common_Result::eType>( + message[strings::params][hmi_response::code].asInt())); break; } default: { @@ -133,7 +133,8 @@ void DialNumberRequest::on_event(const event_engine::Event& event) { void DialNumberRequest::StripNumberParam(std::string& number) { std::size_t found = 0; - while (std::string::npos != (found = number.find_first_not_of("0123456789*#,;+"))) { + while (std::string::npos != + (found = number.find_first_not_of("0123456789*#,;+"))) { number.erase(number.begin() + found); } (*message_)[strings::msg_params][strings::number] = number; diff --git a/src/components/application_manager/src/commands/mobile/dial_number_response.cc b/src/components/application_manager/src/commands/mobile/dial_number_response.cc index ae44597607..750dcf25c4 100644 --- a/src/components/application_manager/src/commands/mobile/dial_number_response.cc +++ b/src/components/application_manager/src/commands/mobile/dial_number_response.cc @@ -32,17 +32,15 @@ #include "application_manager/commands/mobile/dial_number_response.h" - namespace application_manager { namespace commands { -DialNumberResponse::DialNumberResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} +DialNumberResponse::DialNumberResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : CommandResponseImpl(message, application_manager) {} -DialNumberResponse::~DialNumberResponse() { -} +DialNumberResponse::~DialNumberResponse() {} void DialNumberResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/end_audio_pass_thru_request.cc b/src/components/application_manager/src/commands/mobile/end_audio_pass_thru_request.cc index 827eb25526..5a922f595f 100644 --- a/src/components/application_manager/src/commands/mobile/end_audio_pass_thru_request.cc +++ b/src/components/application_manager/src/commands/mobile/end_audio_pass_thru_request.cc @@ -33,18 +33,15 @@ #include "application_manager/commands/mobile/end_audio_pass_thru_request.h" - namespace application_manager { namespace commands { EndAudioPassThruRequest::EndAudioPassThruRequest( - const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : CommandRequestImpl(message, application_manager) {} -EndAudioPassThruRequest::~EndAudioPassThruRequest() { -} +EndAudioPassThruRequest::~EndAudioPassThruRequest() {} void EndAudioPassThruRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -65,11 +62,9 @@ void EndAudioPassThruRequest::on_event(const event_engine::Event& event) { bool result = mobile_apis::Result::SUCCESS == mobile_code; if (result) { - bool ended_successfully = - application_manager_.EndAudioPassThrough(); + bool ended_successfully = application_manager_.EndAudioPassThrough(); if (ended_successfully) { - application_manager_.StopAudioPassThru( - connection_key()); + application_manager_.StopAudioPassThru(connection_key()); } } diff --git a/src/components/application_manager/src/commands/mobile/end_audio_pass_thru_response.cc b/src/components/application_manager/src/commands/mobile/end_audio_pass_thru_response.cc index 2f66b6e70c..bb477f5083 100644 --- a/src/components/application_manager/src/commands/mobile/end_audio_pass_thru_response.cc +++ b/src/components/application_manager/src/commands/mobile/end_audio_pass_thru_response.cc @@ -33,18 +33,15 @@ #include "application_manager/commands/mobile/end_audio_pass_thru_response.h" - namespace application_manager { namespace commands { EndAudioPassThruResponse::EndAudioPassThruResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} + : CommandResponseImpl(message, application_manager) {} -EndAudioPassThruResponse::~EndAudioPassThruResponse() { -} +EndAudioPassThruResponse::~EndAudioPassThruResponse() {} void EndAudioPassThruResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/generic_response.cc b/src/components/application_manager/src/commands/mobile/generic_response.cc index cab1779940..20f6931bb9 100644 --- a/src/components/application_manager/src/commands/mobile/generic_response.cc +++ b/src/components/application_manager/src/commands/mobile/generic_response.cc @@ -55,7 +55,7 @@ void GenericResponse::Run() { (*message_)[strings::params][strings::message_type] = MessageType::kResponse; (*message_)[strings::msg_params][strings::success] = false; (*message_)[strings::msg_params][strings::result_code] = - mobile_apis::Result::INVALID_DATA; + mobile_apis::Result::INVALID_DATA; SendResponse(false); } diff --git a/src/components/application_manager/src/commands/mobile/get_dtcs_request.cc b/src/components/application_manager/src/commands/mobile/get_dtcs_request.cc index 4d2a3ba7a7..80bc89f853 100644 --- a/src/components/application_manager/src/commands/mobile/get_dtcs_request.cc +++ b/src/components/application_manager/src/commands/mobile/get_dtcs_request.cc @@ -40,12 +40,11 @@ namespace application_manager { namespace commands { -GetDTCsRequest::GetDTCsRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager) { -} +GetDTCsRequest::GetDTCsRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : CommandRequestImpl(message, application_manager) {} -GetDTCsRequest::~GetDTCsRequest() { -} +GetDTCsRequest::~GetDTCsRequest() {} void GetDTCsRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -59,8 +58,8 @@ void GetDTCsRequest::Run() { return; } - smart_objects::SmartObject msg_params = smart_objects::SmartObject( - smart_objects::SmartType_Map); + smart_objects::SmartObject msg_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); msg_params[strings::ecu_name] = (*message_)[strings::msg_params][strings::ecu_name]; diff --git a/src/components/application_manager/src/commands/mobile/get_dtcs_response.cc b/src/components/application_manager/src/commands/mobile/get_dtcs_response.cc index 3ba11f560f..ecaf5c3d8f 100644 --- a/src/components/application_manager/src/commands/mobile/get_dtcs_response.cc +++ b/src/components/application_manager/src/commands/mobile/get_dtcs_response.cc @@ -33,17 +33,15 @@ #include "application_manager/commands/mobile/get_dtcs_response.h" - namespace application_manager { namespace commands { -GetDTCsResponse::GetDTCsResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} +GetDTCsResponse::GetDTCsResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : CommandResponseImpl(message, application_manager) {} -GetDTCsResponse::~GetDTCsResponse() { -} +GetDTCsResponse::~GetDTCsResponse() {} void GetDTCsResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc b/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc index 7f13fa0316..8b7010c6a1 100644 --- a/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc +++ b/src/components/application_manager/src/commands/mobile/get_vehicle_data_request.cc @@ -46,20 +46,18 @@ namespace commands { namespace str = strings; #ifdef HMI_DBUS_API -GetVehicleDataRequest::GetVehicleDataRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager) { -} +GetVehicleDataRequest::GetVehicleDataRequest( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : CommandRequestImpl(message, application_manager) {} -GetVehicleDataRequest::~GetVehicleDataRequest() { -} +GetVehicleDataRequest::~GetVehicleDataRequest() {} void GetVehicleDataRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); int32_t app_id = (*message_)[strings::params][strings::connection_key].asUInt(); - ApplicationSharedPtr app = - appplication_manager.application(app_id); + ApplicationSharedPtr app = appplication_manager.application(app_id); if (!app) { LOG4CXX_ERROR(logger_, "NULL pointer"); @@ -71,8 +69,8 @@ void GetVehicleDataRequest::Run() { VehicleData::const_iterator it = vehicle_data.begin(); for (; vehicle_data.end() != it; ++it) { - if (true == (*message_)[str::msg_params].keyExists(it->first) - && true == (*message_)[str::msg_params][it->first].asBool()) { + if (true == (*message_)[str::msg_params].keyExists(it->first) && + true == (*message_)[str::msg_params][it->first].asBool()) { SendRequestsToHmi(app->app_id()); return; } @@ -82,37 +80,44 @@ void GetVehicleDataRequest::Run() { } namespace { - struct Subrequest { - hmi_apis::FunctionID::eType func_id; - const char* str; - }; - Subrequest subrequests[] = { - { hmi_apis::FunctionID::VehicleInfo_GetGpsData, str::gps}, - { hmi_apis::FunctionID::VehicleInfo_GetSpeed, str::speed}, - { hmi_apis::FunctionID::VehicleInfo_GetRpm, str::rpm}, - { hmi_apis::FunctionID::VehicleInfo_GetFuelLevel, str::fuel_level}, - { hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState, str::fuel_level_state}, - { hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption, str::instant_fuel_consumption}, - { hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature, str::external_temp}, - { hmi_apis::FunctionID::VehicleInfo_GetVin, str::vin}, - { hmi_apis::FunctionID::VehicleInfo_GetPrndl, str::prndl}, - { hmi_apis::FunctionID::VehicleInfo_GetTirePressure, str::tire_pressure}, - { hmi_apis::FunctionID::VehicleInfo_GetOdometer, str::odometer}, - { hmi_apis::FunctionID::VehicleInfo_GetBeltStatus, str::belt_status}, - { hmi_apis::FunctionID::VehicleInfo_GetBodyInformation, str::body_information}, - { hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus, str::device_status}, - { hmi_apis::FunctionID::VehicleInfo_GetDriverBraking, str::driver_braking}, - { hmi_apis::FunctionID::VehicleInfo_GetWiperStatus, str::wiper_status}, - { hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus, str::head_lamp_status}, - { hmi_apis::FunctionID::VehicleInfo_GetEngineTorque, str::engine_torque}, - { hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition, str::acc_pedal_pos}, - { hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle, str::steering_wheel_angle}, - { hmi_apis::FunctionID::VehicleInfo_GetECallInfo, str::e_call_info}, - { hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus, str::airbag_status}, - { hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent, str::emergency_event}, - { hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus, str::cluster_mode_status}, - { hmi_apis::FunctionID::VehicleInfo_GetMyKey, str::my_key}, - }; +struct Subrequest { + hmi_apis::FunctionID::eType func_id; + const char* str; +}; +Subrequest subrequests[] = { + {hmi_apis::FunctionID::VehicleInfo_GetGpsData, str::gps}, + {hmi_apis::FunctionID::VehicleInfo_GetSpeed, str::speed}, + {hmi_apis::FunctionID::VehicleInfo_GetRpm, str::rpm}, + {hmi_apis::FunctionID::VehicleInfo_GetFuelLevel, str::fuel_level}, + {hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState, + str::fuel_level_state}, + {hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption, + str::instant_fuel_consumption}, + {hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature, + str::external_temp}, + {hmi_apis::FunctionID::VehicleInfo_GetVin, str::vin}, + {hmi_apis::FunctionID::VehicleInfo_GetPrndl, str::prndl}, + {hmi_apis::FunctionID::VehicleInfo_GetTirePressure, str::tire_pressure}, + {hmi_apis::FunctionID::VehicleInfo_GetOdometer, str::odometer}, + {hmi_apis::FunctionID::VehicleInfo_GetBeltStatus, str::belt_status}, + {hmi_apis::FunctionID::VehicleInfo_GetBodyInformation, + str::body_information}, + {hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus, str::device_status}, + {hmi_apis::FunctionID::VehicleInfo_GetDriverBraking, str::driver_braking}, + {hmi_apis::FunctionID::VehicleInfo_GetWiperStatus, str::wiper_status}, + {hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus, + str::head_lamp_status}, + {hmi_apis::FunctionID::VehicleInfo_GetEngineTorque, str::engine_torque}, + {hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition, str::acc_pedal_pos}, + {hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle, + str::steering_wheel_angle}, + {hmi_apis::FunctionID::VehicleInfo_GetECallInfo, str::e_call_info}, + {hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus, str::airbag_status}, + {hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent, str::emergency_event}, + {hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus, + str::cluster_mode_status}, + {hmi_apis::FunctionID::VehicleInfo_GetMyKey, str::my_key}, +}; } void GetVehicleDataRequest::SendRequestsToHmi(const int32_t app_id) { @@ -121,8 +126,8 @@ void GetVehicleDataRequest::SendRequestsToHmi(const int32_t app_id) { for (size_t i = 0; i < sizeof(subrequests) / sizeof(subrequests[0]); ++i) { const Subrequest& sr = subrequests[i]; - if (true == (*message_)[str::msg_params].keyExists(sr.str) - && true == (*message_)[str::msg_params][sr.str].asBool()) { + if (true == (*message_)[str::msg_params].keyExists(sr.str) && + true == (*message_)[str::msg_params][sr.str].asBool()) { HmiRequest hmi_request; hmi_request.str = sr.str; hmi_request.func_id = sr.func_id; @@ -135,7 +140,8 @@ void GetVehicleDataRequest::SendRequestsToHmi(const int32_t app_id) { hmi_requests_.size() << " requests are going to be sent to HMI"); for (HmiRequests::const_iterator it = hmi_requests_.begin(); - it != hmi_requests_.end(); ++it) { + it != hmi_requests_.end(); + ++it) { SendHMIRequest(it->func_id, &msg_params, true); } } @@ -150,9 +156,8 @@ void GetVehicleDataRequest::on_event(const event_engine::Event& event) { ++it) { HmiRequest& hmi_request = *it; if (hmi_request.func_id == event.id()) { - hmi_request.status = - static_cast<hmi_apis::Common_Result::eType>(message[strings::params][hmi_response::code] - .asInt()); + hmi_request.status = static_cast<hmi_apis::Common_Result::eType>( + message[strings::params][hmi_response::code].asInt()); if (hmi_apis::Common_Result::SUCCESS == hmi_request.status) hmi_request.value = message[str::msg_params][hmi_request.str]; hmi_request.complete = true; @@ -206,16 +211,17 @@ void GetVehicleDataRequest::on_event(const event_engine::Event& event) { } } #else -GetVehicleDataRequest::GetVehicleDataRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager) { -} +GetVehicleDataRequest::GetVehicleDataRequest( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : CommandRequestImpl(message, application_manager) {} GetVehicleDataRequest::~GetVehicleDataRequest() {} void GetVehicleDataRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); - int32_t app_id = (*message_)[strings::params][strings::connection_key].asUInt(); + int32_t app_id = + (*message_)[strings::params][strings::connection_key].asUInt(); ApplicationSharedPtr app = application_manager_.application(app_id); if (!app) { @@ -290,8 +296,8 @@ void GetVehicleDataRequest::on_event(const event_engine::Event& event) { } } -#endif // #ifdef HMI_DBUS_API +#endif // #ifdef HMI_DBUS_API -} // namespace commands +} // namespace commands -} // namespace application_manager +} // namespace application_manager diff --git a/src/components/application_manager/src/commands/mobile/get_vehicle_data_response.cc b/src/components/application_manager/src/commands/mobile/get_vehicle_data_response.cc index 138016832a..1e64746262 100644 --- a/src/components/application_manager/src/commands/mobile/get_vehicle_data_response.cc +++ b/src/components/application_manager/src/commands/mobile/get_vehicle_data_response.cc @@ -39,12 +39,11 @@ namespace application_manager { namespace commands { -GetVehicleDataResponse::GetVehicleDataResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} +GetVehicleDataResponse::GetVehicleDataResponse( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : CommandResponseImpl(message, application_manager) {} -GetVehicleDataResponse::~GetVehicleDataResponse() { -} +GetVehicleDataResponse::~GetVehicleDataResponse() {} void GetVehicleDataResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/get_way_points_request.cc b/src/components/application_manager/src/commands/mobile/get_way_points_request.cc index c7d73288cc..596a8c4627 100644 --- a/src/components/application_manager/src/commands/mobile/get_way_points_request.cc +++ b/src/components/application_manager/src/commands/mobile/get_way_points_request.cc @@ -7,23 +7,21 @@ namespace commands { GetWayPointsRequest::GetWayPointsRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) - :CommandRequestImpl(message, application_manager){ -} + : CommandRequestImpl(message, application_manager) {} GetWayPointsRequest::~GetWayPointsRequest() {} void GetWayPointsRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); - ApplicationSharedPtr app = - application_manager_.application( - connection_key()); + ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { - LOG4CXX_ERROR(logger_, "An application with connection key " - << connection_key() << " is not registered."); - SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); - return; + LOG4CXX_ERROR(logger_, + "An application with connection key " + << connection_key() << " is not registered."); + SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); + return; } SendHMIRequest(hmi_apis::FunctionID::Navigation_GetWayPoints, NULL, true); @@ -31,24 +29,22 @@ void GetWayPointsRequest::Run() { void GetWayPointsRequest::on_event(const event_engine::Event& event) { LOG4CXX_AUTO_TRACE(logger_); - ApplicationSharedPtr app = - application_manager_.application( - connection_key()); - const smart_objects::SmartObject &message = event.smart_object(); - switch(event.id()) { + ApplicationSharedPtr app = application_manager_.application(connection_key()); + const smart_objects::SmartObject& message = event.smart_object(); + switch (event.id()) { case hmi_apis::FunctionID::Navigation_GetWayPoints: { LOG4CXX_INFO(logger_, "Received Navigation_GetWayPoints event"); mobile_apis::Result::eType result_code = - GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>( - message[strings::params][hmi_response::code].asUInt())); + GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>( + message[strings::params][hmi_response::code].asUInt())); bool result = mobile_apis::Result::SUCCESS == result_code; SendResponse(result, result_code, NULL, &(message[strings::msg_params])); break; } - default: { - LOG4CXX_ERROR(logger_, "Received unknown event" << event.id()); - break; - } + default: { + LOG4CXX_ERROR(logger_, "Received unknown event" << event.id()); + break; + } } } diff --git a/src/components/application_manager/src/commands/mobile/get_way_points_response.cc b/src/components/application_manager/src/commands/mobile/get_way_points_response.cc index 615a0996a5..7956b34cae 100644 --- a/src/components/application_manager/src/commands/mobile/get_way_points_response.cc +++ b/src/components/application_manager/src/commands/mobile/get_way_points_response.cc @@ -6,12 +6,10 @@ namespace application_manager { namespace commands { GetWayPointsResponse::GetWayPointsResponse( - const MessageSharedPtr &message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : CommandResponseImpl(message, application_manager) {} -GetWayPointsResponse::~GetWayPointsResponse() { -} +GetWayPointsResponse::~GetWayPointsResponse() {} void GetWayPointsResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/list_files_request.cc b/src/components/application_manager/src/commands/mobile/list_files_request.cc index 7410c12a05..425f1ddb46 100644 --- a/src/components/application_manager/src/commands/mobile/list_files_request.cc +++ b/src/components/application_manager/src/commands/mobile/list_files_request.cc @@ -43,12 +43,11 @@ namespace application_manager { namespace commands { -ListFilesRequest::ListFilesRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager) { -} +ListFilesRequest::ListFilesRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : CommandRequestImpl(message, application_manager) {} -ListFilesRequest::~ListFilesRequest() { -} +ListFilesRequest::~ListFilesRequest() {} void ListFilesRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -65,35 +64,41 @@ void ListFilesRequest::Run() { if ((mobile_api::HMILevel::HMI_NONE == application->hmi_level()) && (application_manager_.get_settings().list_files_in_none() <= application->list_files_in_none_count())) { - // If application is in the HMI_NONE level the quantity of allowed - // DeleteFile request is limited by the configuration profile - LOG4CXX_ERROR(logger_, "Too many requests from the app with HMILevel HMI_NONE "); - SendResponse(false, mobile_apis::Result::REJECTED); - return; + // If application is in the HMI_NONE level the quantity of allowed + // DeleteFile request is limited by the configuration profile + LOG4CXX_ERROR(logger_, + "Too many requests from the app with HMILevel HMI_NONE "); + SendResponse(false, mobile_apis::Result::REJECTED); + return; } application->increment_list_files_in_none_count(); (*message_)[strings::msg_params][strings::space_available] = - static_cast<int32_t>(application->GetAvailableDiskSpace()); + static_cast<int32_t>(application->GetAvailableDiskSpace()); uint32_t i = 0; const AppFilesMap& app_files = application->getAppFiles(); for (AppFilesMap::const_iterator it = app_files.begin(); - it != app_files.end(); ++it) { + it != app_files.end(); + ++it) { std::string filename = it->first.substr(it->first.find_last_of('/') + 1); // In AppFile to application stored full path to file. In message required // to write only name file. // Plus one required for move to next letter after '/'. if (i < application_manager_.get_settings().list_files_response_size()) { - LOG4CXX_DEBUG(logger_, "File " + filename + " added to ListFiles response"); + LOG4CXX_DEBUG(logger_, + "File " + filename + " added to ListFiles response"); (*message_)[strings::msg_params][strings::filenames][i++] = filename; } else { - LOG4CXX_DEBUG(logger_, "File " + filename + " not added to ListFiles response"); + LOG4CXX_DEBUG(logger_, + "File " + filename + " not added to ListFiles response"); } } (*message_)[strings::params][strings::message_type] = application_manager::MessageType::kResponse; - SendResponse(true, mobile_apis::Result::SUCCESS, NULL, + SendResponse(true, + mobile_apis::Result::SUCCESS, + NULL, &(*message_)[strings::msg_params]); } diff --git a/src/components/application_manager/src/commands/mobile/list_files_response.cc b/src/components/application_manager/src/commands/mobile/list_files_response.cc index 8517d37b0d..fde15a94ef 100644 --- a/src/components/application_manager/src/commands/mobile/list_files_response.cc +++ b/src/components/application_manager/src/commands/mobile/list_files_response.cc @@ -39,12 +39,11 @@ namespace application_manager { namespace commands { -ListFilesResponse::ListFilesResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} +ListFilesResponse::ListFilesResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : CommandResponseImpl(message, application_manager) {} -ListFilesResponse::~ListFilesResponse() { -} +ListFilesResponse::~ListFilesResponse() {} void ListFilesResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/on_app_interface_unregistered_notification.cc b/src/components/application_manager/src/commands/mobile/on_app_interface_unregistered_notification.cc index b7a26df478..6064374dab 100644 --- a/src/components/application_manager/src/commands/mobile/on_app_interface_unregistered_notification.cc +++ b/src/components/application_manager/src/commands/mobile/on_app_interface_unregistered_notification.cc @@ -40,11 +40,10 @@ namespace commands { OnAppInterfaceUnregisteredNotification::OnAppInterfaceUnregisteredNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandNotificationImpl(message, application_manager) { -} + : CommandNotificationImpl(message, application_manager) {} -OnAppInterfaceUnregisteredNotification::~OnAppInterfaceUnregisteredNotification() { -} +OnAppInterfaceUnregisteredNotification:: + ~OnAppInterfaceUnregisteredNotification() {} void OnAppInterfaceUnregisteredNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/on_audio_pass_thru_notification.cc b/src/components/application_manager/src/commands/mobile/on_audio_pass_thru_notification.cc index 9b10cd08ad..d0fa3597bc 100644 --- a/src/components/application_manager/src/commands/mobile/on_audio_pass_thru_notification.cc +++ b/src/components/application_manager/src/commands/mobile/on_audio_pass_thru_notification.cc @@ -38,11 +38,9 @@ namespace commands { OnAudioPassThruNotification::OnAudioPassThruNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandNotificationImpl(message, application_manager) { -} + : CommandNotificationImpl(message, application_manager) {} -OnAudioPassThruNotification::~OnAudioPassThruNotification() { -} +OnAudioPassThruNotification::~OnAudioPassThruNotification() {} void OnAudioPassThruNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/on_button_event_notification.cc b/src/components/application_manager/src/commands/mobile/on_button_event_notification.cc index d045dadbe9..fb35257441 100644 --- a/src/components/application_manager/src/commands/mobile/on_button_event_notification.cc +++ b/src/components/application_manager/src/commands/mobile/on_button_event_notification.cc @@ -44,18 +44,15 @@ namespace mobile { OnButtonEventNotification::OnButtonEventNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandNotificationImpl(message, application_manager) { -} + : CommandNotificationImpl(message, application_manager) {} -OnButtonEventNotification::~OnButtonEventNotification() { -} +OnButtonEventNotification::~OnButtonEventNotification() {} void OnButtonEventNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); - const uint32_t btn_id = - static_cast<uint32_t>( - (*message_)[strings::msg_params][hmi_response::button_name].asInt()); + const uint32_t btn_id = static_cast<uint32_t>( + (*message_)[strings::msg_params][hmi_response::button_name].asInt()); // CUSTOM_BUTTON notification if (static_cast<uint32_t>(mobile_apis::ButtonName::CUSTOM_BUTTON) == btn_id) { @@ -66,8 +63,9 @@ void OnButtonEventNotification::Run() { } // 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; @@ -82,8 +80,9 @@ void OnButtonEventNotification::Run() { } uint32_t custom_btn_id = 0; - custom_btn_id = (*message_)[strings::msg_params] - [hmi_response::custom_button_id].asUInt(); + custom_btn_id = + (*message_)[strings::msg_params][hmi_response::custom_button_id] + .asUInt(); if (false == app->IsSubscribedToSoftButton(custom_btn_id)) { LOG4CXX_ERROR(logger_, @@ -106,19 +105,21 @@ void OnButtonEventNotification::Run() { continue; } - //Send ButtonEvent notification only in HMI_FULL or HMI_LIMITED mode + // Send ButtonEvent notification only in HMI_FULL or HMI_LIMITED mode if ((mobile_api::HMILevel::HMI_FULL != subscribed_app->hmi_level()) && (mobile_api::HMILevel::HMI_LIMITED != subscribed_app->hmi_level())) { - LOG4CXX_WARN(logger_, "OnButtonEvent notification is allowed only" - << "in FULL or LIMITED hmi level"); + LOG4CXX_WARN(logger_, + "OnButtonEvent notification is allowed only" + << "in FULL or LIMITED hmi level"); continue; } - //Send ButtonEvent notification for OK button only in HMI_FULL mode + // Send ButtonEvent notification for OK button only in HMI_FULL mode if ((static_cast<uint32_t>(mobile_apis::ButtonName::OK) == btn_id) && (mobile_api::HMILevel::HMI_FULL != subscribed_app->hmi_level())) { - LOG4CXX_WARN(logger_, "OnButtonEvent notification for OK button" - << "is allowed only in FULL hmi level"); + LOG4CXX_WARN(logger_, + "OnButtonEvent notification for OK button" + << "is allowed only in FULL hmi level"); continue; } @@ -132,14 +133,14 @@ void OnButtonEventNotification::SendButtonEvent(ApplicationConstSharedPtr app) { return; } - smart_objects::SmartObjectSPtr on_btn_event = new smart_objects::SmartObject(); + smart_objects::SmartObjectSPtr on_btn_event = + new smart_objects::SmartObject(); if (!on_btn_event) { LOG4CXX_ERROR(logger_, "OnButtonEvent NULL pointer"); return; } - (*on_btn_event)[strings::params][strings::connection_key] = app->app_id(); (*on_btn_event)[strings::params][strings::function_id] = @@ -151,7 +152,7 @@ void OnButtonEventNotification::SendButtonEvent(ApplicationConstSharedPtr app) { (*message_)[strings::msg_params][hmi_response::button_mode]; if ((*message_)[strings::msg_params].keyExists( - hmi_response::custom_button_id)) { + hmi_response::custom_button_id)) { (*on_btn_event)[strings::msg_params][strings::custom_button_id] = (*message_)[strings::msg_params][strings::custom_button_id]; } diff --git a/src/components/application_manager/src/commands/mobile/on_button_press_notification.cc b/src/components/application_manager/src/commands/mobile/on_button_press_notification.cc index 84a59f22e7..d4b7daf185 100644 --- a/src/components/application_manager/src/commands/mobile/on_button_press_notification.cc +++ b/src/components/application_manager/src/commands/mobile/on_button_press_notification.cc @@ -44,18 +44,15 @@ namespace mobile { OnButtonPressNotification::OnButtonPressNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandNotificationImpl(message, application_manager) { -} + : CommandNotificationImpl(message, application_manager) {} -OnButtonPressNotification::~OnButtonPressNotification() { -} +OnButtonPressNotification::~OnButtonPressNotification() {} void OnButtonPressNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); - const uint32_t btn_id = - static_cast<uint32_t>( - (*message_)[strings::msg_params][hmi_response::button_name].asInt()); + const uint32_t btn_id = static_cast<uint32_t>( + (*message_)[strings::msg_params][hmi_response::button_name].asInt()); // CUSTOM_BUTTON notification if (static_cast<uint32_t>(mobile_apis::ButtonName::CUSTOM_BUTTON) == btn_id) { @@ -66,8 +63,9 @@ void OnButtonPressNotification::Run() { } // 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; @@ -82,8 +80,9 @@ void OnButtonPressNotification::Run() { } uint32_t custom_btn_id = 0; - custom_btn_id = (*message_)[strings::msg_params] - [hmi_response::custom_button_id].asUInt(); + custom_btn_id = + (*message_)[strings::msg_params][hmi_response::custom_button_id] + .asUInt(); if (false == app->IsSubscribedToSoftButton(custom_btn_id)) { LOG4CXX_ERROR(logger_, @@ -106,19 +105,21 @@ void OnButtonPressNotification::Run() { continue; } - //Send ButtonPress notification only in HMI_FULL or HMI_LIMITED mode + // Send ButtonPress notification only in HMI_FULL or HMI_LIMITED mode if ((mobile_api::HMILevel::HMI_FULL != subscribed_app->hmi_level()) && (mobile_api::HMILevel::HMI_LIMITED != subscribed_app->hmi_level())) { - LOG4CXX_WARN(logger_, "OnButtonPress notification is allowed only" - << "in FULL or LIMITED hmi level"); + LOG4CXX_WARN(logger_, + "OnButtonPress notification is allowed only" + << "in FULL or LIMITED hmi level"); continue; } - //Send ButtonPress notification for OK button only in HMI_FULL mode + // Send ButtonPress notification for OK button only in HMI_FULL mode if ((static_cast<uint32_t>(mobile_apis::ButtonName::OK) == btn_id) && (mobile_api::HMILevel::HMI_FULL != subscribed_app->hmi_level())) { - LOG4CXX_WARN(logger_, "OnButtonPress notification for OK button" - << "is allowed only in FULL hmi level"); + LOG4CXX_WARN(logger_, + "OnButtonPress notification for OK button" + << "is allowed only in FULL hmi level"); continue; } @@ -132,14 +133,14 @@ void OnButtonPressNotification::SendButtonPress(ApplicationConstSharedPtr app) { return; } - smart_objects::SmartObjectSPtr on_btn_press = new smart_objects::SmartObject(); + smart_objects::SmartObjectSPtr on_btn_press = + new smart_objects::SmartObject(); if (!on_btn_press) { LOG4CXX_ERROR(logger_, "OnButtonPress NULL pointer"); return; } - (*on_btn_press)[strings::params][strings::connection_key] = app->app_id(); (*on_btn_press)[strings::params][strings::function_id] = @@ -151,7 +152,7 @@ void OnButtonPressNotification::SendButtonPress(ApplicationConstSharedPtr app) { (*message_)[strings::msg_params][hmi_response::button_mode]; if ((*message_)[strings::msg_params].keyExists( - hmi_response::custom_button_id)) { + hmi_response::custom_button_id)) { (*on_btn_press)[strings::msg_params][strings::custom_button_id] = (*message_)[strings::msg_params][strings::custom_button_id]; } diff --git a/src/components/application_manager/src/commands/mobile/on_command_notification.cc b/src/components/application_manager/src/commands/mobile/on_command_notification.cc index 5a9070d1af..ae8aeff771 100644 --- a/src/components/application_manager/src/commands/mobile/on_command_notification.cc +++ b/src/components/application_manager/src/commands/mobile/on_command_notification.cc @@ -39,12 +39,11 @@ namespace application_manager { namespace commands { -OnCommandNotification::OnCommandNotification(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandNotificationImpl(message, application_manager) { -} +OnCommandNotification::OnCommandNotification( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : CommandNotificationImpl(message, application_manager) {} -OnCommandNotification::~OnCommandNotification() { -} +OnCommandNotification::~OnCommandNotification() {} void OnCommandNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -57,12 +56,11 @@ void OnCommandNotification::Run() { return; } - const uint32_t cmd_id = (*message_)[strings::msg_params][strings::cmd_id] - .asUInt(); + const uint32_t cmd_id = + (*message_)[strings::msg_params][strings::cmd_id].asUInt(); if (!app->FindCommand(cmd_id)) { - LOG4CXX_ERROR(logger_, - " No applications found for the command " << cmd_id); + LOG4CXX_ERROR(logger_, " No applications found for the command " << cmd_id); return; } diff --git a/src/components/application_manager/src/commands/mobile/on_driver_distraction_notification.cc b/src/components/application_manager/src/commands/mobile/on_driver_distraction_notification.cc index f55527736c..44ed2cf3b7 100644 --- a/src/components/application_manager/src/commands/mobile/on_driver_distraction_notification.cc +++ b/src/components/application_manager/src/commands/mobile/on_driver_distraction_notification.cc @@ -44,11 +44,9 @@ namespace mobile { OnDriverDistractionNotification::OnDriverDistractionNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandNotificationImpl(message, application_manager) { -} + : CommandNotificationImpl(message, application_manager) {} -OnDriverDistractionNotification::~OnDriverDistractionNotification() { -} +OnDriverDistractionNotification::~OnDriverDistractionNotification() {} void OnDriverDistractionNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/on_hash_change_notification.cc b/src/components/application_manager/src/commands/mobile/on_hash_change_notification.cc index c8df30d451..19b93f2cbf 100644 --- a/src/components/application_manager/src/commands/mobile/on_hash_change_notification.cc +++ b/src/components/application_manager/src/commands/mobile/on_hash_change_notification.cc @@ -46,11 +46,9 @@ namespace mobile { OnHashChangeNotification::OnHashChangeNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandNotificationImpl(message, application_manager) { -} + : CommandNotificationImpl(message, application_manager) {} -OnHashChangeNotification::~OnHashChangeNotification() { -} +OnHashChangeNotification::~OnHashChangeNotification() {} void OnHashChangeNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -65,12 +63,12 @@ void OnHashChangeNotification::Run() { (*message_)[strings::msg_params][strings::hash_id] = app->curHash(); SendNotification(); } else { - LOG4CXX_WARN(logger_, "Application with app_id " << app_id << " does not exist"); + LOG4CXX_WARN(logger_, + "Application with app_id " << app_id << " does not exist"); } - } -} //namespace mobile +} // namespace mobile } // namespace commands diff --git a/src/components/application_manager/src/commands/mobile/on_hmi_status_notification.cc b/src/components/application_manager/src/commands/mobile/on_hmi_status_notification.cc index 7c267f06e1..5225002652 100644 --- a/src/components/application_manager/src/commands/mobile/on_hmi_status_notification.cc +++ b/src/components/application_manager/src/commands/mobile/on_hmi_status_notification.cc @@ -42,19 +42,16 @@ namespace commands { OnHMIStatusNotification::OnHMIStatusNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandNotificationImpl(message, application_manager) { -} + : CommandNotificationImpl(message, application_manager) {} -OnHMIStatusNotification::~OnHMIStatusNotification() { -} +OnHMIStatusNotification::~OnHMIStatusNotification() {} void OnHMIStatusNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); - (*message_)[strings::params][strings::message_type] = static_cast<int32_t> ( - application_manager::MessageType::kNotification); - ApplicationSharedPtr app = application_manager_.application( - connection_key()); + (*message_)[strings::params][strings::message_type] = + static_cast<int32_t>(application_manager::MessageType::kNotification); + ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app.valid()) { LOG4CXX_ERROR(logger_, "OnHMIStatusNotification application doesn't exist"); return; @@ -67,18 +64,18 @@ void OnHMIStatusNotification::Run() { (mobile_apis::HMILevel::HMI_NONE == hmi_level)) { if (!(app->tts_properties_in_none())) { app->set_tts_properties_in_none(true); - LOG4CXX_INFO(logger_, "OnHMIStatusNotification::Send TTS GlobalProperties" + LOG4CXX_INFO(logger_, + "OnHMIStatusNotification::Send TTS GlobalProperties" " with empty array to HMI"); MessageHelper::SendTTSGlobalProperties(app, false, application_manager_); } } else if ((mobile_apis::HMILevel::HMI_FULL == hmi_level) || - (mobile_apis::HMILevel::HMI_LIMITED == hmi_level)) { + (mobile_apis::HMILevel::HMI_LIMITED == hmi_level)) { if (!(app->tts_properties_in_full())) { app->set_tts_properties_in_full(true); LOG4CXX_INFO(logger_, "OnHMIStatusNotification AddAppToTTSGlobalPropertiesList"); - application_manager_.AddAppToTTSGlobalPropertiesList( - app->app_id()); + application_manager_.AddAppToTTSGlobalPropertiesList(app->app_id()); } } SendNotification(); diff --git a/src/components/application_manager/src/commands/mobile/on_hmi_status_notification_from_mobile.cc b/src/components/application_manager/src/commands/mobile/on_hmi_status_notification_from_mobile.cc index c729882ae4..9b16bd3572 100644 --- a/src/components/application_manager/src/commands/mobile/on_hmi_status_notification_from_mobile.cc +++ b/src/components/application_manager/src/commands/mobile/on_hmi_status_notification_from_mobile.cc @@ -39,8 +39,7 @@ namespace application_manager { namespace commands { OnHMIStatusNotificationFromMobile::OnHMIStatusNotificationFromMobile( - const MessageSharedPtr& message, - ApplicationManager& application_manager) + const MessageSharedPtr& message, ApplicationManager& application_manager) : CommandNotificationFromMobileImpl(message, application_manager) {} OnHMIStatusNotificationFromMobile::~OnHMIStatusNotificationFromMobile() {} @@ -50,8 +49,7 @@ void OnHMIStatusNotificationFromMobile::Run() { (*message_)[strings::params][strings::message_type] = static_cast<int32_t>(application_manager::MessageType::kNotification); - ApplicationSharedPtr app = - application_manager_.application(connection_key()); + ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app.valid()) { LOG4CXX_ERROR( @@ -72,11 +70,9 @@ void OnHMIStatusNotificationFromMobile::Run() { bool is_apps_requested_before = application_manager_.IsAppsQueriedFrom(handle); - LOG4CXX_DEBUG( - logger_, - "Mobile HMI state notication came for connection key:" << connection_key() - << " and handle: " - << handle); + LOG4CXX_DEBUG(logger_, + "Mobile HMI state notication came for connection key:" + << connection_key() << " and handle: " << handle); if (!is_apps_requested_before && ProtocolVersion::kV4 == app->protocol_version() && app->is_foreground()) { @@ -109,7 +105,8 @@ void OnHMIStatusNotificationFromMobile::Run() { } if (!is_another_foreground_sdl4_app) { - application_manager_.MarkAppsGreyOut(handle, !is_current_state_foreground); + application_manager_.MarkAppsGreyOut(handle, + !is_current_state_foreground); application_manager_.SendUpdateAppList(); } } diff --git a/src/components/application_manager/src/commands/mobile/on_language_change_notification.cc b/src/components/application_manager/src/commands/mobile/on_language_change_notification.cc index f94cda91b2..76420b85b6 100644 --- a/src/components/application_manager/src/commands/mobile/on_language_change_notification.cc +++ b/src/components/application_manager/src/commands/mobile/on_language_change_notification.cc @@ -39,11 +39,9 @@ namespace commands { OnLanguageChangeNotification::OnLanguageChangeNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandNotificationImpl(message, application_manager) { -} + : CommandNotificationImpl(message, application_manager) {} -OnLanguageChangeNotification::~OnLanguageChangeNotification() { -} +OnLanguageChangeNotification::~OnLanguageChangeNotification() {} void OnLanguageChangeNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/on_permissions_change_notification.cc b/src/components/application_manager/src/commands/mobile/on_permissions_change_notification.cc index 4d2f66075c..a4167a802e 100644 --- a/src/components/application_manager/src/commands/mobile/on_permissions_change_notification.cc +++ b/src/components/application_manager/src/commands/mobile/on_permissions_change_notification.cc @@ -41,11 +41,9 @@ namespace commands { OnPermissionsChangeNotification::OnPermissionsChangeNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandNotificationImpl(message, application_manager) { -} + : CommandNotificationImpl(message, application_manager) {} -OnPermissionsChangeNotification::~OnPermissionsChangeNotification() { -} +OnPermissionsChangeNotification::~OnPermissionsChangeNotification() {} void OnPermissionsChangeNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/on_system_request_notification.cc b/src/components/application_manager/src/commands/mobile/on_system_request_notification.cc index 14cbff8d28..4f73ad0ffe 100644 --- a/src/components/application_manager/src/commands/mobile/on_system_request_notification.cc +++ b/src/components/application_manager/src/commands/mobile/on_system_request_notification.cc @@ -45,34 +45,33 @@ namespace mobile { OnSystemRequestNotification::OnSystemRequestNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandNotificationImpl(message, application_manager) { -} + : CommandNotificationImpl(message, application_manager) {} -OnSystemRequestNotification::~OnSystemRequestNotification() { -} +OnSystemRequestNotification::~OnSystemRequestNotification() {} void OnSystemRequestNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); using namespace application_manager; using namespace mobile_apis; - ApplicationSharedPtr app = application_manager_. - application(connection_key()); + ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app.valid()) { - LOG4CXX_ERROR(logger_, "Application with connection key " - << connection_key() << " is not registered."); + LOG4CXX_ERROR(logger_, + "Application with connection key " << connection_key() + << " is not registered."); return; } - RequestType::eType request_type = static_cast<RequestType::eType> - ((*message_)[strings::msg_params][strings::request_type].asInt()); + RequestType::eType request_type = static_cast<RequestType::eType>( + (*message_)[strings::msg_params][strings::request_type].asInt()); const policy::PolicyHandlerInterface& policy_handler = application_manager_.GetPolicyHandler(); if (!policy_handler.IsRequestTypeAllowed(app->policy_app_id(), request_type)) { - LOG4CXX_WARN(logger_, "Request type " << request_type - <<" is not allowed by policies"); + LOG4CXX_WARN(logger_, + "Request type " << request_type + << " is not allowed by policies"); return; } @@ -80,7 +79,8 @@ void OnSystemRequestNotification::Run() { /* According to requirements: "If the requestType = PROPRIETARY, add to mobile API fileType = JSON If the requestType = HTTP, add to mobile API fileType = BINARY" - Also in Genivi SDL we don't save the PT to file - we put it directly in binary_data */ + Also in Genivi SDL we don't save the PT to file - we put it directly in + binary_data */ (*message_)[strings::msg_params][strings::file_type] = FileType::JSON; } else if (RequestType::HTTP == request_type) { (*message_)[strings::msg_params][strings::file_type] = FileType::BINARY; @@ -89,7 +89,7 @@ void OnSystemRequestNotification::Run() { SendNotification(); } -} //namespace mobile +} // namespace mobile } // namespace commands diff --git a/src/components/application_manager/src/commands/mobile/on_tbt_client_state_notification.cc b/src/components/application_manager/src/commands/mobile/on_tbt_client_state_notification.cc index aae32c4115..894469ac34 100644 --- a/src/components/application_manager/src/commands/mobile/on_tbt_client_state_notification.cc +++ b/src/components/application_manager/src/commands/mobile/on_tbt_client_state_notification.cc @@ -42,11 +42,9 @@ namespace commands { OnTBTClientStateNotification::OnTBTClientStateNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandNotificationImpl(message, application_manager) { -} + : CommandNotificationImpl(message, application_manager) {} -OnTBTClientStateNotification::~OnTBTClientStateNotification() { -} +OnTBTClientStateNotification::~OnTBTClientStateNotification() {} void OnTBTClientStateNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/on_touch_event_notification.cc b/src/components/application_manager/src/commands/mobile/on_touch_event_notification.cc index 3c0b0a5657..c769194c95 100644 --- a/src/components/application_manager/src/commands/mobile/on_touch_event_notification.cc +++ b/src/components/application_manager/src/commands/mobile/on_touch_event_notification.cc @@ -43,11 +43,9 @@ namespace mobile { OnTouchEventNotification::OnTouchEventNotification( const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandNotificationImpl(message, application_manager) { -} + : CommandNotificationImpl(message, application_manager) {} -OnTouchEventNotification::~OnTouchEventNotification() { -} +OnTouchEventNotification::~OnTouchEventNotification() {} void OnTouchEventNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/on_vehicle_data_notification.cc b/src/components/application_manager/src/commands/mobile/on_vehicle_data_notification.cc index ec74c1c621..37abbab351 100644 --- a/src/components/application_manager/src/commands/mobile/on_vehicle_data_notification.cc +++ b/src/components/application_manager/src/commands/mobile/on_vehicle_data_notification.cc @@ -42,19 +42,17 @@ namespace application_manager { namespace commands { OnVehicleDataNotification::OnVehicleDataNotification( - const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandNotificationImpl(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : CommandNotificationImpl(message, application_manager) {} -OnVehicleDataNotification::~OnVehicleDataNotification() { -} +OnVehicleDataNotification::~OnVehicleDataNotification() {} void OnVehicleDataNotification::Run() { LOG4CXX_AUTO_TRACE(logger_); std::vector<ApplicationSharedPtr> appNotification; std::vector<ApplicationSharedPtr>::iterator appNotification_it = - appNotification.begin(); + appNotification.begin(); std::vector<smart_objects::SmartObject> appSO; const VehicleData& vehicle_data = MessageHelper::vehicle_data(); @@ -63,45 +61,47 @@ void OnVehicleDataNotification::Run() { for (; vehicle_data.end() != it; ++it) { if (true == (*message_)[strings::msg_params].keyExists(it->first)) { const std::vector<ApplicationSharedPtr>& applications = - application_manager_.IviInfoUpdated(it->second, - (*message_)[strings::msg_params][it->first].asInt()); + application_manager_.IviInfoUpdated( + it->second, (*message_)[strings::msg_params][it->first].asInt()); std::vector<ApplicationSharedPtr>::const_iterator app_it = - applications.begin(); + applications.begin(); for (; applications.end() != app_it; ++app_it) { const ApplicationSharedPtr app = *app_it; if (!app) { LOG4CXX_ERROR(logger_, "NULL pointer"); continue; -} + } - appNotification_it = find(appNotification.begin(), appNotification.end(), app); + appNotification_it = + find(appNotification.begin(), appNotification.end(), app); if (appNotification_it == appNotification.end()) { appNotification.push_back(app); - smart_objects::SmartObject msg_param = smart_objects::SmartObject( - smart_objects::SmartType_Map); + smart_objects::SmartObject msg_param = + smart_objects::SmartObject(smart_objects::SmartType_Map); msg_param[it->first] = (*message_)[strings::msg_params][it->first]; appSO.push_back(msg_param); } else { - size_t idx = std::distance(appNotification.begin(), appNotification_it); + size_t idx = + std::distance(appNotification.begin(), appNotification_it); appSO[idx][it->first] = (*message_)[strings::msg_params][it->first]; - } } } } - LOG4CXX_DEBUG(logger_, "Number of Notifications to be send: " << - appNotification.size()); + LOG4CXX_DEBUG( + logger_, + "Number of Notifications to be send: " << appNotification.size()); for (size_t idx = 0; idx < appNotification.size(); idx++) { - LOG4CXX_INFO( - logger_, - "Send OnVehicleData PRNDL notification to " << appNotification[idx]->name().c_str() - << " application id " << appNotification[idx]->app_id()); + LOG4CXX_INFO(logger_, + "Send OnVehicleData PRNDL notification to " + << appNotification[idx]->name().c_str() + << " application id " << appNotification[idx]->app_id()); (*message_)[strings::params][strings::connection_key] = - appNotification[idx]->app_id(); + appNotification[idx]->app_id(); (*message_)[strings::msg_params] = appSO[idx]; SendNotification(); } diff --git a/src/components/application_manager/src/commands/mobile/on_way_point_change_notification.cc b/src/components/application_manager/src/commands/mobile/on_way_point_change_notification.cc index 3a0cf0143c..0b24228810 100644 --- a/src/components/application_manager/src/commands/mobile/on_way_point_change_notification.cc +++ b/src/components/application_manager/src/commands/mobile/on_way_point_change_notification.cc @@ -51,7 +51,8 @@ void OnWayPointChangeNotification::Run() { for (std::set<int32_t>::const_iterator app_id = subscribed_for_way_points.begin(); - app_id != subscribed_for_way_points.end(); ++app_id) { + app_id != subscribed_for_way_points.end(); + ++app_id) { (*message_)[strings::params][strings::connection_key] = *app_id; SendNotification(); } diff --git a/src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_request.cc b/src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_request.cc index 55619bc318..d595119d45 100644 --- a/src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_request.cc +++ b/src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_request.cc @@ -46,14 +46,13 @@ namespace str = strings; PerformAudioPassThruRequest::PerformAudioPassThruRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager), - is_active_tts_speak_(false), - result_tts_speak_(mobile_apis::Result::SUCCESS) { + : CommandRequestImpl(message, application_manager) + , is_active_tts_speak_(false) + , result_tts_speak_(mobile_apis::Result::SUCCESS) { subscribe_on_event(hmi_apis::FunctionID::TTS_OnResetTimeout); } -PerformAudioPassThruRequest::~PerformAudioPassThruRequest() { -} +PerformAudioPassThruRequest::~PerformAudioPassThruRequest() {} void PerformAudioPassThruRequest::onTimeOut() { LOG4CXX_AUTO_TRACE(logger_); @@ -71,8 +70,7 @@ bool PerformAudioPassThruRequest::Init() { void PerformAudioPassThruRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); - ApplicationSharedPtr app = - application_manager_.application(connection_key()); + ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { LOG4CXX_ERROR(logger_, "APPLICATION_NOT_REGISTERED"); @@ -136,18 +134,16 @@ void PerformAudioPassThruRequest::on_event(const event_engine::Event& event) { FinishTTSSpeak(); std::string return_info; - const bool result = - Compare<mobile_api::Result::eType, EQ, ONE>( - mobile_code, - mobile_apis::Result::SUCCESS, - mobile_apis::Result::RETRY, - mobile_apis::Result::WARNINGS); - - const bool is_result_ok = - Compare<mobile_api::Result::eType, EQ, ONE>( - mobile_code, - mobile_apis::Result::SUCCESS, - mobile_apis::Result::WARNINGS); + const bool result = Compare<mobile_api::Result::eType, EQ, ONE>( + mobile_code, + mobile_apis::Result::SUCCESS, + mobile_apis::Result::RETRY, + mobile_apis::Result::WARNINGS); + + const bool is_result_ok = Compare<mobile_api::Result::eType, EQ, ONE>( + mobile_code, + mobile_apis::Result::SUCCESS, + mobile_apis::Result::WARNINGS); if (is_result_ok && mobile_apis::Result::UNSUPPORTED_RESOURCE == result_tts_speak_) { @@ -155,25 +151,25 @@ void PerformAudioPassThruRequest::on_event(const event_engine::Event& event) { return_info = "Unsupported phoneme type sent in a prompt"; } - SendResponse(result, mobile_code, return_info.empty() ? NULL : return_info.c_str(), + SendResponse(result, + mobile_code, + return_info.empty() ? NULL : return_info.c_str(), &(message[strings::msg_params])); break; } case hmi_apis::FunctionID::TTS_Speak: { LOG4CXX_INFO(logger_, "Received TTS_Speak event"); - result_tts_speak_ = GetMobileResultCode( - static_cast<hmi_apis::Common_Result::eType>( - message[strings::params][hmi_response::code].asUInt())); + result_tts_speak_ = + GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>( + message[strings::params][hmi_response::code].asUInt())); is_active_tts_speak_ = false; if (mobile_apis::Result::SUCCESS == result_tts_speak_) { SendRecordStartNotification(); StartMicrophoneRecording(); // update request timeout to get time for perform audio recording - application_manager_. - updateRequestTimeout(connection_key(), - correlation_id(), - default_timeout()); + application_manager_.updateRequestTimeout( + connection_key(), correlation_id(), default_timeout()); } break; } @@ -202,8 +198,8 @@ void PerformAudioPassThruRequest::SendSpeakRequest() { if ((*message_)[str::msg_params].keyExists(str::initial_prompt) && (0 < (*message_)[str::msg_params][str::initial_prompt].length())) { for (uint32_t i = 0; - i < (*message_)[str::msg_params][str::initial_prompt].length(); - ++i) { + i < (*message_)[str::msg_params][str::initial_prompt].length(); + ++i) { msg_params[hmi_request::tts_chunks][i][str::text] = (*message_)[str::msg_params][str::initial_prompt][i][str::text]; msg_params[hmi_request::tts_chunks][i][str::type] = @@ -220,8 +216,8 @@ void PerformAudioPassThruRequest::SendSpeakRequest() { void PerformAudioPassThruRequest::SendPerformAudioPassThruRequest() { LOG4CXX_AUTO_TRACE(logger_); - smart_objects::SmartObject msg_params = smart_objects::SmartObject( - smart_objects::SmartType_Map); + smart_objects::SmartObject msg_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); msg_params[str::app_id] = connection_key(); @@ -232,21 +228,21 @@ void PerformAudioPassThruRequest::SendPerformAudioPassThruRequest() { smart_objects::SmartObject(smart_objects::SmartType_Array); if ((*message_)[str::msg_params].keyExists(str::audio_pass_display_text1)) { - msg_params[hmi_request::audio_pass_display_texts] - [0][hmi_request::field_name] = static_cast<int32_t> - (hmi_apis::Common_TextFieldName::audioPassThruDisplayText1); - msg_params[hmi_request::audio_pass_display_texts] - [0][hmi_request::field_text] = - (*message_)[str::msg_params][str::audio_pass_display_text1]; + msg_params[hmi_request::audio_pass_display_texts][0] + [hmi_request::field_name] = static_cast<int32_t>( + hmi_apis::Common_TextFieldName::audioPassThruDisplayText1); + msg_params[hmi_request::audio_pass_display_texts][0] + [hmi_request::field_text] = + (*message_)[str::msg_params][str::audio_pass_display_text1]; } if ((*message_)[str::msg_params].keyExists(str::audio_pass_display_text2)) { - msg_params[hmi_request::audio_pass_display_texts] - [1][hmi_request::field_name] = static_cast<int32_t> - (hmi_apis::Common_TextFieldName::audioPassThruDisplayText2); - msg_params[hmi_request::audio_pass_display_texts] - [1][hmi_request::field_text] = - (*message_)[str::msg_params][str::audio_pass_display_text2]; + msg_params[hmi_request::audio_pass_display_texts][1] + [hmi_request::field_name] = static_cast<int32_t>( + hmi_apis::Common_TextFieldName::audioPassThruDisplayText2); + msg_params[hmi_request::audio_pass_display_texts][1] + [hmi_request::field_text] = + (*message_)[str::msg_params][str::audio_pass_display_text2]; } if ((*message_)[str::msg_params].keyExists(str::mute_audio)) { @@ -257,15 +253,15 @@ void PerformAudioPassThruRequest::SendPerformAudioPassThruRequest() { msg_params[str::mute_audio] = true; } - SendHMIRequest(hmi_apis::FunctionID::UI_PerformAudioPassThru, - &msg_params, true); + SendHMIRequest( + hmi_apis::FunctionID::UI_PerformAudioPassThru, &msg_params, true); } void PerformAudioPassThruRequest::SendRecordStartNotification() { LOG4CXX_AUTO_TRACE(logger_); - smart_objects::SmartObject msg_params = smart_objects::SmartObject( - smart_objects::SmartType_Map); + smart_objects::SmartObject msg_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); msg_params[strings::app_id] = connection_key(); CreateHMINotification(hmi_apis::FunctionID::UI_OnRecordStart, msg_params); @@ -277,7 +273,8 @@ void PerformAudioPassThruRequest::StartMicrophoneRecording() { application_manager_.BeginAudioPassThrough(); application_manager_.StartAudioPassThruThread( - connection_key(), correlation_id(), + connection_key(), + correlation_id(), (*message_)[str::msg_params][str::max_duration].asInt(), (*message_)[str::msg_params][str::sampling_rate].asInt(), (*message_)[str::msg_params][str::bits_per_sample].asInt(), @@ -304,25 +301,25 @@ bool PerformAudioPassThruRequest::IsWhiteSpaceExist() { } } - if ((*message_)[strings::msg_params]. - keyExists(strings::audio_pass_display_text1)) { - - str = (*message_)[strings::msg_params] - [strings::audio_pass_display_text1].asCharArray(); + if ((*message_)[strings::msg_params].keyExists( + strings::audio_pass_display_text1)) { + str = (*message_)[strings::msg_params][strings::audio_pass_display_text1] + .asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, + LOG4CXX_ERROR( + logger_, "Invalid audio_pass_display_text1 value syntax check failed"); return true; } } - if ((*message_)[strings::msg_params]. - keyExists(strings::audio_pass_display_text2)) { - - str = (*message_)[strings::msg_params] - [strings::audio_pass_display_text2].asCharArray(); + if ((*message_)[strings::msg_params].keyExists( + strings::audio_pass_display_text2)) { + str = (*message_)[strings::msg_params][strings::audio_pass_display_text2] + .asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, + LOG4CXX_ERROR( + logger_, "Invalid audio_pass_display_text2 value syntax check failed"); return true; } @@ -330,7 +327,7 @@ bool PerformAudioPassThruRequest::IsWhiteSpaceExist() { return false; } -void PerformAudioPassThruRequest::FinishTTSSpeak(){ +void PerformAudioPassThruRequest::FinishTTSSpeak() { LOG4CXX_AUTO_TRACE(logger_); if (application_manager_.EndAudioPassThrough()) { LOG4CXX_DEBUG(logger_, "Stop AudioPassThru."); @@ -352,16 +349,17 @@ bool PerformAudioPassThruRequest::WaitTTSSpeak() { // Waiting for TTS_Speak while (is_active_tts_speak_) { - uint64_t difference_between_start_current_time - = date_time::DateTime::calculateTimeSpan(start_time); + uint64_t difference_between_start_current_time = + date_time::DateTime::calculateTimeSpan(start_time); // Send GENERIC_ERROR after default timeout if (difference_between_start_current_time > default_timeout_msec) { LOG4CXX_WARN(logger_, "Expired timeout for TTS.Speak response"); // Don't use onTimeOut(), because default_timeout_ is bigger than // Default time in *.ini file FinishTTSSpeak(); - SendResponse(false, mobile_apis::Result::eType::GENERIC_ERROR, - "Expired timeout for TTS.Speak response"); + SendResponse(false, + mobile_apis::Result::eType::GENERIC_ERROR, + "Expired timeout for TTS.Speak response"); return false; } } diff --git a/src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_response.cc b/src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_response.cc index 411a0a41ae..e8a638c076 100644 --- a/src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_response.cc +++ b/src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_response.cc @@ -33,19 +33,15 @@ #include "application_manager/commands/mobile/perform_audio_pass_thru_response.h" - - namespace application_manager { namespace commands { PerformAudioPassThruResponse::PerformAudioPassThruResponse( - const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : CommandResponseImpl(message, application_manager) {} -PerformAudioPassThruResponse::~PerformAudioPassThruResponse() { -} +PerformAudioPassThruResponse::~PerformAudioPassThruResponse() {} void PerformAudioPassThruResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/perform_interaction_request.cc b/src/components/application_manager/src/commands/mobile/perform_interaction_request.cc index 4745587fe6..39ad51e822 100644 --- a/src/components/application_manager/src/commands/mobile/perform_interaction_request.cc +++ b/src/components/application_manager/src/commands/mobile/perform_interaction_request.cc @@ -45,8 +45,6 @@ #include "utils/custom_string.h" #include "utils/gen_hash.h" - - namespace application_manager { namespace commands { @@ -56,23 +54,22 @@ namespace custom_str = utils::custom_string; uint32_t PerformInteractionRequest::pi_requests_count_ = 0; PerformInteractionRequest::PerformInteractionRequest( - const MessageSharedPtr& message, ApplicationManager& application_manager) -: CommandRequestImpl(message, application_manager), - interaction_mode_(mobile_apis::InteractionMode::INVALID_ENUM), - ui_response_recived_(false), - vr_response_recived_(false), - ui_result_(false), - vr_result_(false), - app_pi_was_active_before_(false), - vr_resultCode_(mobile_apis::Result::INVALID_ENUM), - ui_resultCode_(mobile_apis::Result::INVALID_ENUM) { + const MessageSharedPtr& message, ApplicationManager& application_manager) + : CommandRequestImpl(message, application_manager) + , interaction_mode_(mobile_apis::InteractionMode::INVALID_ENUM) + , ui_response_recived_(false) + , vr_response_recived_(false) + , ui_result_(false) + , vr_result_(false) + , app_pi_was_active_before_(false) + , vr_resultCode_(mobile_apis::Result::INVALID_ENUM) + , ui_resultCode_(mobile_apis::Result::INVALID_ENUM) { subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout); subscribe_on_event(hmi_apis::FunctionID::VR_OnCommand); subscribe_on_event(hmi_apis::FunctionID::Buttons_OnButtonPress); } -PerformInteractionRequest::~PerformInteractionRequest() { -} +PerformInteractionRequest::~PerformInteractionRequest() {} bool PerformInteractionRequest::Init() { /* Timeout in milliseconds. @@ -95,8 +92,7 @@ bool PerformInteractionRequest::Init() { void PerformInteractionRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); - ApplicationSharedPtr app = - application_manager_.application(connection_key()); + ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { LOG4CXX_ERROR(logger_, "Application is not registered"); @@ -120,8 +116,9 @@ void PerformInteractionRequest::Run() { if ((mobile_apis::InteractionMode::VR_ONLY == interaction_mode_) && (mobile_apis::LayoutMode::KEYBOARD == interaction_layout)) { - LOG4CXX_ERROR(logger_, "PerformInteraction contains InteractionMode" - "=VR_ONLY and interactionLayout=KEYBOARD"); + LOG4CXX_ERROR(logger_, + "PerformInteraction contains InteractionMode" + "=VR_ONLY and interactionLayout=KEYBOARD"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } @@ -132,15 +129,17 @@ void PerformInteractionRequest::Run() { if (0 == choice_set_id_list_length) { if (mobile_apis::LayoutMode::KEYBOARD == interaction_layout) { if (mobile_apis::InteractionMode::BOTH == interaction_mode_) { - LOG4CXX_ERROR(logger_,"interactionChoiceSetIDList is empty," - " InteractionMode=BOTH and" - " interactionLayout=KEYBOARD"); + LOG4CXX_ERROR(logger_, + "interactionChoiceSetIDList is empty," + " InteractionMode=BOTH and" + " interactionLayout=KEYBOARD"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } } else { - LOG4CXX_ERROR(logger_,"interactionChoiceSetIDList is empty" - " and interactionLayout!=KEYBOARD"); + LOG4CXX_ERROR(logger_, + "interactionChoiceSetIDList is empty" + " and interactionLayout!=KEYBOARD"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } @@ -148,20 +147,22 @@ void PerformInteractionRequest::Run() { if (choice_set_id_list_length && (!CheckChoiceIDFromRequest( - app, choice_set_id_list_length, - msg_params[strings::interaction_choice_set_id_list]))) { - - LOG4CXX_ERROR(logger_,"PerformInteraction has choice sets with " - "duplicated IDs or application does not have choice sets"); + app, + choice_set_id_list_length, + msg_params[strings::interaction_choice_set_id_list]))) { + LOG4CXX_ERROR(logger_, + "PerformInteraction has choice sets with " + "duplicated IDs or application does not have choice sets"); SendResponse(false, mobile_apis::Result::INVALID_ID); return; } if (msg_params.keyExists(strings::vr_help)) { - if (mobile_apis::Result::SUCCESS != MessageHelper::VerifyImageVrHelpItems( - msg_params[strings::vr_help], app, application_manager_)) { - LOG4CXX_ERROR(logger_, "Verification of " << strings::vr_help - << " failed."); + if (mobile_apis::Result::SUCCESS != + MessageHelper::VerifyImageVrHelpItems( + msg_params[strings::vr_help], app, application_manager_)) { + LOG4CXX_ERROR(logger_, + "Verification of " << strings::vr_help << " failed."); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; } @@ -177,8 +178,7 @@ void PerformInteractionRequest::Run() { switch (interaction_mode_) { case mobile_apis::InteractionMode::BOTH: { LOG4CXX_DEBUG(logger_, "Interaction Mode: BOTH"); - if (!CheckChoiceSetVRSynonyms(app) || - !CheckChoiceSetMenuNames(app) || + if (!CheckChoiceSetVRSynonyms(app) || !CheckChoiceSetMenuNames(app) || !CheckVrHelpItemPositions(app)) { return; } @@ -186,8 +186,7 @@ void PerformInteractionRequest::Run() { } case mobile_apis::InteractionMode::MANUAL_ONLY: { LOG4CXX_DEBUG(logger_, "Interaction Mode: MANUAL_ONLY"); - if (!CheckChoiceSetVRSynonyms(app) || - !CheckChoiceSetMenuNames(app) || + if (!CheckChoiceSetVRSynonyms(app) || !CheckChoiceSetMenuNames(app) || !CheckVrHelpItemPositions(app)) { return; } @@ -195,8 +194,7 @@ void PerformInteractionRequest::Run() { } case mobile_apis::InteractionMode::VR_ONLY: { LOG4CXX_DEBUG(logger_, "Interaction Mode: VR_ONLY"); - if (!CheckChoiceSetVRSynonyms(app) || - !CheckVrHelpItemPositions(app)) { + if (!CheckChoiceSetVRSynonyms(app) || !CheckVrHelpItemPositions(app)) { return; } break; @@ -225,15 +223,16 @@ void PerformInteractionRequest::on_event(const event_engine::Event& event) { case hmi_apis::FunctionID::UI_OnResetTimeout: { LOG4CXX_DEBUG(logger_, "Received UI_OnResetTimeout event"); application_manager_.updateRequestTimeout( - connection_key(), correlation_id(), default_timeout()); + connection_key(), correlation_id(), default_timeout()); break; } case hmi_apis::FunctionID::UI_PerformInteraction: { LOG4CXX_DEBUG(logger_, "Received UI_PerformInteraction event"); ui_response_recived_ = true; unsubscribe_from_event(hmi_apis::FunctionID::UI_PerformInteraction); - ui_resultCode_ = GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>( - message[strings::params][hmi_response::code].asUInt())); + ui_resultCode_ = + GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>( + message[strings::params][hmi_response::code].asUInt())); ProcessPerformInteractionResponse(event.smart_object(), msg_param); break; } @@ -241,8 +240,9 @@ void PerformInteractionRequest::on_event(const event_engine::Event& event) { LOG4CXX_DEBUG(logger_, "Received VR_PerformInteraction"); vr_response_recived_ = true; unsubscribe_from_event(hmi_apis::FunctionID::VR_PerformInteraction); - vr_resultCode_ = GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>( - message[strings::params][hmi_response::code].asUInt())); + vr_resultCode_ = + GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>( + message[strings::params][hmi_response::code].asUInt())); ProcessVRResponse(event.smart_object(), msg_param); break; } @@ -270,13 +270,13 @@ void PerformInteractionRequest::onTimeOut() { CommandRequestImpl::onTimeOut(); } else { application_manager_.updateRequestTimeout( - connection_key(), correlation_id(), default_timeout()); + connection_key(), correlation_id(), default_timeout()); } break; } case mobile_apis::InteractionMode::VR_ONLY: { application_manager_.updateRequestTimeout( - connection_key(), correlation_id(), default_timeout()); + connection_key(), correlation_id(), default_timeout()); break; } case mobile_apis::InteractionMode::MANUAL_ONLY: { @@ -292,7 +292,6 @@ void PerformInteractionRequest::onTimeOut() { }; } - void PerformInteractionRequest::ProcessVRResponse( const smart_objects::SmartObject& message, smart_objects::SmartObject& msg_params) { @@ -302,8 +301,7 @@ void PerformInteractionRequest::ProcessVRResponse( using namespace smart_objects; using namespace helpers; - ApplicationSharedPtr app = - application_manager_.application(connection_key()); + ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { LOG4CXX_ERROR(logger_, "NULL pointer"); @@ -315,9 +313,7 @@ void PerformInteractionRequest::ProcessVRResponse( static_cast<int32_t>(TriggerSource::TS_VR); const bool is_vr_aborted_timeout = - Compare<Result::eType, EQ, ONE>(vr_resultCode_, - ABORTED, - TIMED_OUT); + Compare<Result::eType, EQ, ONE>(vr_resultCode_, ABORTED, TIMED_OUT); if (is_vr_aborted_timeout) { LOG4CXX_DEBUG(logger_, "VR response aborted"); @@ -328,17 +324,16 @@ void PerformInteractionRequest::ProcessVRResponse( return; } LOG4CXX_DEBUG(logger_, "Update timeout for UI"); - application_manager_. - updateRequestTimeout(connection_key(), - correlation_id(), - default_timeout()); + application_manager_.updateRequestTimeout( + connection_key(), correlation_id(), default_timeout()); return; } if (SUCCESS == vr_resultCode_ && InteractionMode::MANUAL_ONLY == interaction_mode_) { - LOG4CXX_DEBUG(logger_, "VR response SUCCESS in MANUAL_ONLY mode " << - "Wait for UI response"); + LOG4CXX_DEBUG(logger_, + "VR response SUCCESS in MANUAL_ONLY mode " + << "Wait for UI response"); // in case MANUAL_ONLY mode VR.PI SUCCESS just return return; } @@ -349,7 +344,8 @@ void PerformInteractionRequest::ProcessVRResponse( if (!CheckChoiceIDFromResponse(app, choise_id)) { LOG4CXX_ERROR(logger_, "Wrong choiceID was received from HMI"); TerminatePerformInteraction(); - SendResponse(false, GENERIC_ERROR,"Wrong choiceID was received from HMI"); + SendResponse( + false, GENERIC_ERROR, "Wrong choiceID was received from HMI"); return; } msg_params[strings::choice_id] = choise_id; @@ -375,29 +371,23 @@ void PerformInteractionRequest::ProcessPerformInteractionResponse( using namespace helpers; using namespace smart_objects; - ApplicationSharedPtr app = - application_manager_.application(connection_key()); + ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { LOG4CXX_ERROR(logger_, "NULL pointer"); return; } - ui_result_ = - Compare<mobile_api::Result::eType, EQ, ONE>( - ui_resultCode_, - mobile_apis::Result::SUCCESS, - mobile_apis::Result::WARNINGS, - mobile_apis::Result::UNSUPPORTED_RESOURCE); + ui_result_ = Compare<mobile_api::Result::eType, EQ, ONE>( + ui_resultCode_, + mobile_apis::Result::SUCCESS, + mobile_apis::Result::WARNINGS, + mobile_apis::Result::UNSUPPORTED_RESOURCE); - const bool is_pi_warning = - Compare<mobile_api::Result::eType, EQ, ONE>( - ui_resultCode_, - mobile_apis::Result::WARNINGS); + const bool is_pi_warning = Compare<mobile_api::Result::eType, EQ, ONE>( + ui_resultCode_, mobile_apis::Result::WARNINGS); - const bool is_pi_unsupported = - Compare<mobile_api::Result::eType, EQ, ONE>( - ui_resultCode_, - mobile_apis::Result::UNSUPPORTED_RESOURCE); + const bool is_pi_unsupported = Compare<mobile_api::Result::eType, EQ, ONE>( + ui_resultCode_, mobile_apis::Result::UNSUPPORTED_RESOURCE); std::string info; @@ -405,8 +395,8 @@ void PerformInteractionRequest::ProcessPerformInteractionResponse( if (is_pi_warning) { ui_resultCode_ = mobile_apis::Result::WARNINGS; info = "Unsupported phoneme type was sent in an item"; - if (message.keyExists(strings::params) - && message[strings::params].keyExists(strings::data)) { + if (message.keyExists(strings::params) && + message[strings::params].keyExists(strings::data)) { msg_params = message[strings::params][strings::data]; } } else if (is_pi_unsupported) { @@ -436,10 +426,7 @@ void PerformInteractionRequest::ProcessPerformInteractionResponse( DisablePerformInteraction(); - const SmartObject* response_params = - msg_params.empty() - ? NULL - : &msg_params; + const SmartObject* response_params = msg_params.empty() ? NULL : &msg_params; if (mobile_apis::InteractionMode::BOTH != interaction_mode_) { DisablePerformInteraction(); @@ -527,8 +514,8 @@ void PerformInteractionRequest::SendUIPerformInteractionRequest( (*message_)[strings::msg_params][hmi_request::interaction_layout] .asInt(); } - SendHMIRequest(hmi_apis::FunctionID::UI_PerformInteraction, - &msg_params, true); + SendHMIRequest( + hmi_apis::FunctionID::UI_PerformInteraction, &msg_params, true); } void PerformInteractionRequest::SendVRPerformInteractionRequest( @@ -539,7 +526,7 @@ void PerformInteractionRequest::SendVRPerformInteractionRequest( smart_objects::SmartObject(smart_objects::SmartType_Map); smart_objects::SmartObject& choice_list = - (*message_)[strings::msg_params][strings::interaction_choice_set_id_list]; + (*message_)[strings::msg_params][strings::interaction_choice_set_id_list]; if (mobile_apis::InteractionMode::MANUAL_ONLY != interaction_mode_) { msg_params[strings::grammar_id] = @@ -553,7 +540,7 @@ void PerformInteractionRequest::SendVRPerformInteractionRequest( LOG4CXX_WARN(logger_, "Couldn't found choiset"); continue; } - msg_params[strings::grammar_id][grammar_id_index++]= + msg_params[strings::grammar_id][grammar_id_index++] = (*choice_set)[strings::grammar_id].asUInt(); } } @@ -582,8 +569,9 @@ void PerformInteractionRequest::SendVRPerformInteractionRequest( // Since there is no custom data from application side, SDL should // construct prompt and append delimiter to each item item[strings::type] = hmi_apis::Common_SpeechCapabilities::SC_TEXT; - item[strings::text] = vr_commands[0].asString() + - application_manager_.get_settings().tts_delimiter(); + item[strings::text] = + vr_commands[0].asString() + + application_manager_.get_settings().tts_delimiter(); msg_params[strings::help_prompt][index++] = item; } } @@ -595,7 +583,7 @@ void PerformInteractionRequest::SendVRPerformInteractionRequest( if ((*message_)[strings::msg_params].keyExists(strings::timeout_prompt)) { msg_params[strings::timeout_prompt] = - (*message_)[strings::msg_params][strings::timeout_prompt]; + (*message_)[strings::msg_params][strings::timeout_prompt]; } else { if (msg_params.keyExists(strings::help_prompt)) { msg_params[strings::timeout_prompt] = msg_params[strings::help_prompt]; @@ -603,8 +591,8 @@ void PerformInteractionRequest::SendVRPerformInteractionRequest( } if ((*message_)[strings::msg_params].keyExists(strings::initial_prompt)) { - msg_params[strings::initial_prompt] = - (*message_)[strings::msg_params][strings::initial_prompt]; + msg_params[strings::initial_prompt] = + (*message_)[strings::msg_params][strings::initial_prompt]; } mobile_apis::InteractionMode::eType mode = @@ -618,8 +606,8 @@ void PerformInteractionRequest::SendVRPerformInteractionRequest( msg_params[strings::timeout] = default_timeout_; } msg_params[strings::app_id] = app->app_id(); - SendHMIRequest(hmi_apis::FunctionID::VR_PerformInteraction, &msg_params, - true); + SendHMIRequest( + hmi_apis::FunctionID::VR_PerformInteraction, &msg_params, true); } bool PerformInteractionRequest::CheckChoiceSetMenuNames( @@ -631,12 +619,12 @@ bool PerformInteractionRequest::CheckChoiceSetMenuNames( for (size_t i = 0; i < choice_list.length(); ++i) { // choice_set contains SmartObject msg_params - smart_objects::SmartObject* i_choice_set = app->FindChoiceSet( - choice_list[i].asInt()); + smart_objects::SmartObject* i_choice_set = + app->FindChoiceSet(choice_list[i].asInt()); for (size_t j = 0; j < choice_list.length(); ++j) { - smart_objects::SmartObject* j_choice_set = app->FindChoiceSet( - choice_list[j].asInt()); + smart_objects::SmartObject* j_choice_set = + app->FindChoiceSet(choice_list[j].asInt()); if (i == j) { // skip check the same element @@ -662,7 +650,8 @@ bool PerformInteractionRequest::CheckChoiceSetMenuNames( if (ii_menu_name == jj_menu_name) { LOG4CXX_ERROR(logger_, "Choice set has duplicated menu name"); - SendResponse(false, mobile_apis::Result::DUPLICATE_NAME, + SendResponse(false, + mobile_apis::Result::DUPLICATE_NAME, "Choice set has duplicated menu name"); return false; } @@ -750,7 +739,8 @@ bool PerformInteractionRequest::CheckVrHelpItemPositions( for (size_t i = 0; i < vr_help.length(); ++i) { if (position != vr_help[i][strings::position].asInt()) { LOG4CXX_ERROR(logger_, "Non-sequential vrHelp item position"); - SendResponse(false, mobile_apis::Result::REJECTED, + SendResponse(false, + mobile_apis::Result::REJECTED, "Non-sequential vrHelp item position"); return false; } @@ -789,7 +779,6 @@ bool PerformInteractionRequest::IsWhiteSpaceExist() { return true; } - if ((*message_)[strings::msg_params].keyExists(strings::initial_prompt)) { const smart_objects::SmartArray* ip_array = (*message_)[strings::msg_params][strings::initial_prompt].asArray(); @@ -868,8 +857,8 @@ bool PerformInteractionRequest::IsWhiteSpaceExist() { void PerformInteractionRequest::TerminatePerformInteraction() { LOG4CXX_AUTO_TRACE(logger_); - smart_objects::SmartObject msg_params = smart_objects::SmartObject( - smart_objects::SmartType_Map); + smart_objects::SmartObject msg_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); msg_params[hmi_request::method_name] = "UI.PerformInteraction"; SendHMIRequest(hmi_apis::FunctionID::UI_ClosePopUp, &msg_params); DisablePerformInteraction(); @@ -888,8 +877,8 @@ bool PerformInteractionRequest::CheckChoiceIDFromResponse( const PerformChoice& choice = choice_set_map_it->second; PerformChoice::const_iterator it = choice.begin(); for (; choice.end() != it; ++it) { - const smart_objects::SmartObject& choice_set = (*it->second).getElement( - strings::choice_set); + const smart_objects::SmartObject& choice_set = + (*it->second).getElement(strings::choice_set); for (size_t j = 0; j < choice_set.length(); ++j) { if (choice_id == choice_set.getElement(j).getElement(strings::choice_id).asInt()) { @@ -915,19 +904,22 @@ bool PerformInteractionRequest::CheckChoiceIDFromRequest( for (size_t i = 0; i < choice_set_id_list_length; ++i) { choice_set = app->FindChoiceSet(choice_set_id_list[i].asInt()); if (!choice_set) { - LOG4CXX_ERROR(logger_, "Couldn't find choiset_id = " - <<choice_set_id_list[i].asInt()); + LOG4CXX_ERROR( + logger_, + "Couldn't find choiset_id = " << choice_set_id_list[i].asInt()); return false; } choice_list_length = (*choice_set)[strings::choice_set].length(); const smart_objects::SmartObject& choices_list = (*choice_set)[strings::choice_set]; for (size_t k = 0; k < choice_list_length; ++k) { - ins_res = choice_id_set.insert(choices_list[k][strings::choice_id].asInt()); + ins_res = + choice_id_set.insert(choices_list[k][strings::choice_id].asInt()); if (!ins_res.second) { - LOG4CXX_ERROR(logger_, "Choise with ID " - << choices_list[k][strings::choice_id].asInt() - << " already exists"); + LOG4CXX_ERROR(logger_, + "Choise with ID " + << choices_list[k][strings::choice_id].asInt() + << " already exists"); return false; } } @@ -951,7 +943,7 @@ void PerformInteractionRequest::CheckResponseResultCode() { LOG4CXX_DEBUG(logger_, "VR had been rejected."); resultCode = mobile_apis::Result::REJECTED; } else if (mobile_apis::Result::WARNINGS == vr_resultCode_ || - mobile_apis::Result::UNSUPPORTED_REQUEST == vr_resultCode_) { + mobile_apis::Result::UNSUPPORTED_REQUEST == vr_resultCode_) { LOG4CXX_DEBUG(logger_, "VR response WARNINGS"); resultCode = mobile_api::Result::WARNINGS; result = true; @@ -975,21 +967,19 @@ void PerformInteractionRequest::SendBothModeResponse( UNSUPPORTED_RESOURCE != ui_resultCode_) { perform_interaction_result_code = vr_resultCode_; } else if (UNSUPPORTED_RESOURCE == vr_resultCode_ && - UNSUPPORTED_RESOURCE == ui_resultCode_) { + UNSUPPORTED_RESOURCE == ui_resultCode_) { result = false; } const bool is_error_code = (SUCCESS != perform_interaction_result_code || - WARNINGS != perform_interaction_result_code); + WARNINGS != perform_interaction_result_code); if (vr_resultCode_ == ui_resultCode_ && is_error_code) { result = false; } const smart_objects::SmartObject* response_params = - msg_param.empty() - ? NULL - : &msg_param; + msg_param.empty() ? NULL : &msg_param; TerminatePerformInteraction(); SendResponse(result, perform_interaction_result_code, NULL, response_params); diff --git a/src/components/application_manager/src/commands/mobile/perform_interaction_response.cc b/src/components/application_manager/src/commands/mobile/perform_interaction_response.cc index 16a8e9616c..6003751669 100644 --- a/src/components/application_manager/src/commands/mobile/perform_interaction_response.cc +++ b/src/components/application_manager/src/commands/mobile/perform_interaction_response.cc @@ -33,18 +33,15 @@ #include "application_manager/commands/mobile/perform_interaction_response.h" - namespace application_manager { namespace commands { PerformInteractionResponse::PerformInteractionResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} + : CommandResponseImpl(message, application_manager) {} -PerformInteractionResponse::~PerformInteractionResponse() { -} +PerformInteractionResponse::~PerformInteractionResponse() {} void PerformInteractionResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/put_file_request.cc b/src/components/application_manager/src/commands/mobile/put_file_request.cc index 9ff52da8f4..68e7ad60d1 100644 --- a/src/components/application_manager/src/commands/mobile/put_file_request.cc +++ b/src/components/application_manager/src/commands/mobile/put_file_request.cc @@ -43,25 +43,24 @@ namespace application_manager { namespace commands { -PutFileRequest::PutFileRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager) - , offset_(0) - , sync_file_name_() - , length_(0) - , file_type_(mobile_apis::FileType::INVALID_ENUM) - , is_persistent_file_(false) { -} +PutFileRequest::PutFileRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : CommandRequestImpl(message, application_manager) + , offset_(0) + , sync_file_name_() + , length_(0) + , file_type_(mobile_apis::FileType::INVALID_ENUM) + , is_persistent_file_(false) {} -PutFileRequest::~PutFileRequest() { -} +PutFileRequest::~PutFileRequest() {} void PutFileRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); ApplicationSharedPtr application = application_manager_.application(connection_key()); - smart_objects::SmartObject response_params = smart_objects::SmartObject( - smart_objects::SmartType_Map); + smart_objects::SmartObject response_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); if (!application) { LOG4CXX_ERROR(logger_, "Application is not registered"); @@ -71,12 +70,13 @@ void PutFileRequest::Run() { if (mobile_api::HMILevel::HMI_NONE == application->hmi_level() && application_manager_.get_settings().put_file_in_none() <= - application->put_file_in_none_count()) { + application->put_file_in_none_count()) { // If application is in the HMI_NONE level the quantity of allowed // PutFile request is limited by the configuration profile LOG4CXX_ERROR(logger_, "Too many requests from the app with HMILevel HMI_NONE "); - SendResponse(false, mobile_apis::Result::REJECTED, + SendResponse(false, + mobile_apis::Result::REJECTED, "Too many requests from the app with HMILevel HMI_NONE", &response_params); return; @@ -84,7 +84,8 @@ void PutFileRequest::Run() { if (!(*message_)[strings::params].keyExists(strings::binary_data)) { LOG4CXX_ERROR(logger_, "Binary data empty"); - SendResponse(false, mobile_apis::Result::INVALID_DATA, + SendResponse(false, + mobile_apis::Result::INVALID_DATA, "Binary data empty", &response_params); return; @@ -92,7 +93,8 @@ void PutFileRequest::Run() { if (!(*message_)[strings::msg_params].keyExists(strings::sync_file_name)) { LOG4CXX_ERROR(logger_, "No file name"); - SendResponse(false, mobile_apis::Result::INVALID_DATA, + SendResponse(false, + mobile_apis::Result::INVALID_DATA, "No file name", &response_params); return; @@ -100,24 +102,24 @@ void PutFileRequest::Run() { if (!(*message_)[strings::msg_params].keyExists(strings::file_type)) { LOG4CXX_ERROR(logger_, "No file type"); - SendResponse(false, mobile_apis::Result::INVALID_DATA, + SendResponse(false, + mobile_apis::Result::INVALID_DATA, "No file type", &response_params); return; } sync_file_name_ = - (*message_)[strings::msg_params][strings::sync_file_name].asString(); - file_type_ = - static_cast<mobile_apis::FileType::eType>( + (*message_)[strings::msg_params][strings::sync_file_name].asString(); + file_type_ = static_cast<mobile_apis::FileType::eType>( (*message_)[strings::msg_params][strings::file_type].asInt()); const std::vector<uint8_t> binary_data = - (*message_)[strings::params][strings::binary_data].asBinary(); + (*message_)[strings::params][strings::binary_data].asBinary(); // Policy table update in json format is currently to be received via PutFile // TODO(PV): after latest discussion has to be changed if (mobile_apis::FileType::JSON == file_type_) { - application_manager_.GetPolicyHandler() - .ReceiveMessageFromSDK(sync_file_name_, binary_data); + application_manager_.GetPolicyHandler().ReceiveMessageFromSDK( + sync_file_name_, binary_data); } offset_ = 0; @@ -132,15 +134,13 @@ void PutFileRequest::Run() { offset_ = (*message_)[strings::msg_params][strings::offset].asInt(); } - if ((*message_)[strings::msg_params]. - keyExists(strings::persistent_file)) { + if ((*message_)[strings::msg_params].keyExists(strings::persistent_file)) { is_persistent_file_ = - (*message_)[strings::msg_params][strings::persistent_file].asBool(); + (*message_)[strings::msg_params][strings::persistent_file].asBool(); } - if ((*message_)[strings::msg_params]. - keyExists(strings::system_file)) { + if ((*message_)[strings::msg_params].keyExists(strings::system_file)) { is_system_file = - (*message_)[strings::msg_params][strings::system_file].asBool(); + (*message_)[strings::msg_params][strings::system_file].asBool(); } std::string file_path; @@ -155,39 +155,42 @@ void PutFileRequest::Run() { uint32_t space_available = application->GetAvailableDiskSpace(); if (binary_data.size() > space_available) { - response_params[strings::space_available] = static_cast<uint32_t>(space_available); LOG4CXX_ERROR(logger_, "Out of memory"); - SendResponse(false, mobile_apis::Result::OUT_OF_MEMORY, - "Out of memory", &response_params); + SendResponse(false, + mobile_apis::Result::OUT_OF_MEMORY, + "Out of memory", + &response_params); return; } } if (!file_system::CreateDirectoryRecursively(file_path)) { LOG4CXX_ERROR(logger_, "Can't create folder"); - SendResponse(false, mobile_apis::Result::GENERIC_ERROR, - "Can't create folder.", &response_params); + SendResponse(false, + mobile_apis::Result::GENERIC_ERROR, + "Can't create folder.", + &response_params); return; } const std::string full_path = file_path + "/" + sync_file_name_; UNUSED(full_path); - LOG4CXX_DEBUG(logger_, "Wrtiting " << binary_data.size() << "bytes to " - << full_path << " (current size is" - << file_system::FileSize(full_path) << ")"); - - mobile_apis::Result::eType save_result = - application_manager_.SaveBinary(binary_data, file_path, - sync_file_name_, offset_); - - LOG4CXX_DEBUG(logger_, "New size of " - << full_path << " is " - << file_system::FileSize(full_path) << " bytes"); + LOG4CXX_DEBUG(logger_, + "Wrtiting " << binary_data.size() << "bytes to " << full_path + << " (current size is" + << file_system::FileSize(full_path) << ")"); + + mobile_apis::Result::eType save_result = application_manager_.SaveBinary( + binary_data, file_path, sync_file_name_, offset_); + + LOG4CXX_DEBUG(logger_, + "New size of " << full_path << " is " + << file_system::FileSize(full_path) << " bytes"); if (!is_system_file) { - response_params[strings::space_available] = static_cast<uint32_t>( - application->GetAvailableDiskSpace()); + response_params[strings::space_available] = + static_cast<uint32_t>(application->GetAvailableDiskSpace()); } sync_file_name_ = file_path + "/" + sync_file_name_; @@ -195,23 +198,25 @@ void PutFileRequest::Run() { case mobile_apis::Result::SUCCESS: { LOG4CXX_INFO(logger_, "PutFile is successful"); if (!is_system_file) { - AppFile file(sync_file_name_, is_persistent_file_, - is_download_compleate, file_type_); + AppFile file(sync_file_name_, + is_persistent_file_, + is_download_compleate, + file_type_); if (0 == offset_) { LOG4CXX_INFO(logger_, "New file downloading"); if (!application->AddFile(file)) { - LOG4CXX_INFO(logger_, "Couldn't add file to application (File already Exist" - << " in application and was rewritten on FS)"); + << " in application and was rewritten on FS)"); /* It can be first part of new big file, so we need to update information about it's downloading status and persistence */ if (!application->UpdateFile(file)) { LOG4CXX_ERROR(logger_, "Couldn't update file"); /* If it is impossible to update file, application doesn't know about existing this file */ - SendResponse(false, mobile_apis::Result::INVALID_DATA, + SendResponse(false, + mobile_apis::Result::INVALID_DATA, "Couldn't update file", &response_params); return; @@ -232,20 +237,21 @@ void PutFileRequest::Run() { break; } default: - LOG4CXX_WARN(logger_, "PutFile is unsuccessful. Result = " << save_result); + LOG4CXX_WARN(logger_, + "PutFile is unsuccessful. Result = " << save_result); SendResponse(false, save_result, "Can't save file", &response_params); break; } } void PutFileRequest::SendOnPutFileNotification() { - LOG4CXX_INFO(logger_, "SendOnPutFileNotification" ); - smart_objects::SmartObjectSPtr notification = new smart_objects::SmartObject( - smart_objects::SmartType_Map); + LOG4CXX_INFO(logger_, "SendOnPutFileNotification"); + smart_objects::SmartObjectSPtr notification = + new smart_objects::SmartObject(smart_objects::SmartType_Map); smart_objects::SmartObject& message = *notification; message[strings::params][strings::function_id] = - hmi_apis::FunctionID::BasicCommunication_OnPutFile; + hmi_apis::FunctionID::BasicCommunication_OnPutFile; message[strings::params][strings::message_type] = MessageType::kNotification; message[strings::msg_params][strings::app_id] = connection_key(); diff --git a/src/components/application_manager/src/commands/mobile/put_file_response.cc b/src/components/application_manager/src/commands/mobile/put_file_response.cc index 08d936863a..50c62aef7f 100644 --- a/src/components/application_manager/src/commands/mobile/put_file_response.cc +++ b/src/components/application_manager/src/commands/mobile/put_file_response.cc @@ -35,22 +35,20 @@ #include "utils/file_system.h" #include "application_manager/application_impl.h" - namespace application_manager { namespace commands { -PutFileResponse::PutFileResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} +PutFileResponse::PutFileResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : CommandResponseImpl(message, application_manager) {} -PutFileResponse::~PutFileResponse() { -} +PutFileResponse::~PutFileResponse() {} void PutFileResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); - uint32_t app_id = (*message_)[strings::params][strings::connection_key] - .asUInt(); + uint32_t app_id = + (*message_)[strings::params][strings::connection_key].asUInt(); ApplicationSharedPtr app = application_manager_.application(app_id); if (!app) { LOG4CXX_ERROR(logger_, "Application not registered"); @@ -58,7 +56,6 @@ void PutFileResponse::Run() { return; } - SendResponse((*message_)[strings::msg_params][strings::success].asBool()); } diff --git a/src/components/application_manager/src/commands/mobile/read_did_request.cc b/src/components/application_manager/src/commands/mobile/read_did_request.cc index f37e02bc7d..69885f9d40 100644 --- a/src/components/application_manager/src/commands/mobile/read_did_request.cc +++ b/src/components/application_manager/src/commands/mobile/read_did_request.cc @@ -41,22 +41,23 @@ namespace application_manager { namespace commands { -ReadDIDRequest::ReadDIDRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager) { -} +ReadDIDRequest::ReadDIDRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : CommandRequestImpl(message, application_manager) {} -ReadDIDRequest::~ReadDIDRequest() { -} +ReadDIDRequest::~ReadDIDRequest() {} void ReadDIDRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); - uint32_t app_id = (*message_)[strings::params][strings::connection_key] - .asUInt(); + uint32_t app_id = + (*message_)[strings::params][strings::connection_key].asUInt(); ApplicationSharedPtr app = application_manager_.application(app_id); - LOG4CXX_INFO(logger_, "Correlation_id :" << (*message_)[strings::params][strings::correlation_id] - .asUInt()); + LOG4CXX_INFO( + logger_, + "Correlation_id :" + << (*message_)[strings::params][strings::correlation_id].asUInt()); if (!app) { LOG4CXX_ERROR(logger_, "An application is not registered."); @@ -65,8 +66,8 @@ void ReadDIDRequest::Run() { } if (app->IsCommandLimitsExceeded( - static_cast<mobile_apis::FunctionID::eType>(function_id()), - application_manager::TLimitSource::CONFIG_FILE)) { + static_cast<mobile_apis::FunctionID::eType>(function_id()), + application_manager::TLimitSource::CONFIG_FILE)) { LOG4CXX_ERROR(logger_, "ReadDID frequency is too high."); SendResponse(false, mobile_apis::Result::REJECTED); return; @@ -78,8 +79,8 @@ void ReadDIDRequest::Run() { return; } - smart_objects::SmartObject msg_params = smart_objects::SmartObject( - smart_objects::SmartType_Map); + smart_objects::SmartObject msg_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); msg_params[strings::app_id] = app->app_id(); msg_params[strings::ecu_name] = (*message_)[strings::msg_params][strings::ecu_name]; @@ -104,7 +105,9 @@ void ReadDIDRequest::on_event(const event_engine::Event& event) { const std::string return_info = message[strings::msg_params][hmi_response::message].asString(); - SendResponse(result, result_code, return_info.c_str(), + SendResponse(result, + result_code, + return_info.c_str(), &(message[strings::msg_params])); break; } diff --git a/src/components/application_manager/src/commands/mobile/read_did_response.cc b/src/components/application_manager/src/commands/mobile/read_did_response.cc index 1637f3e9bc..e54c4ba005 100644 --- a/src/components/application_manager/src/commands/mobile/read_did_response.cc +++ b/src/components/application_manager/src/commands/mobile/read_did_response.cc @@ -33,17 +33,15 @@ #include "application_manager/commands/mobile/read_did_response.h" - namespace application_manager { namespace commands { -ReadDIDResponse::ReadDIDResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} +ReadDIDResponse::ReadDIDResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : CommandResponseImpl(message, application_manager) {} -ReadDIDResponse::~ReadDIDResponse() { -} +ReadDIDResponse::~ReadDIDResponse() {} void ReadDIDResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc b/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc index 23fba2edcc..eea2f443b7 100644 --- a/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc +++ b/src/components/application_manager/src/commands/mobile/register_app_interface_request.cc @@ -187,8 +187,8 @@ void RegisterAppInterfaceRequest::Run() { const std::string& policy_app_id = msg_params[strings::app_id].asString(); - if (application_manager_.IsApplicationForbidden( - connection_key(), policy_app_id)) { + if (application_manager_.IsApplicationForbidden(connection_key(), + policy_app_id)) { SendResponse(false, mobile_apis::Result::TOO_MANY_PENDING_REQUESTS); return; } @@ -230,16 +230,14 @@ void RegisterAppInterfaceRequest::Run() { return; } - application = - application_manager_.RegisterApplication(message_); + application = application_manager_.RegisterApplication(message_); if (!application) { LOG4CXX_ERROR(logger_, "Application hasn't been registered!"); return; } // For resuming application need to restore hmi_app_id from resumeCtrl - resumption::ResumeCtrl& resumer = - application_manager_.resume_controller(); + 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 @@ -323,11 +321,9 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile() { application_manager_.hmi_capabilities(); const uint32_t key = connection_key(); - ApplicationSharedPtr application = - application_manager_.application(key); + ApplicationSharedPtr application = application_manager_.application(key); - resumption::ResumeCtrl& resumer = - application_manager_.resume_controller(); + resumption::ResumeCtrl& resumer = application_manager_.resume_controller(); if (!application) { LOG4CXX_ERROR(logger_, @@ -338,9 +334,9 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile() { } response_params[strings::sync_msg_version][strings::major_version] = - major_version; // From generated file interfaces/generated_msg_version.h + major_version; // From generated file interfaces/generated_msg_version.h response_params[strings::sync_msg_version][strings::minor_version] = - minor_version; // From generated file interfaces/generated_msg_version.h + minor_version; // From generated file interfaces/generated_msg_version.h response_params[strings::language] = hmi_capabilities.active_vr_language(); response_params[strings::hmi_display_language] = @@ -534,9 +530,8 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile() { // in case application exist in resumption we need to send resumeVrgrammars if (false == resumption) { - resumption = resumer.IsApplicationSaved( - application->policy_app_id(), - application->mac_address()); + resumption = resumer.IsApplicationSaved(application->policy_app_id(), + application->mac_address()); } SendOnAppRegisteredNotificationToHMI( @@ -551,7 +546,8 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile() { // By default app subscribed to CUSTOM_BUTTON SendSubscribeCustomButtonNotification(); - MessageHelper::SendChangeRegistrationRequestToHMI(application, application_manager_); + MessageHelper::SendChangeRegistrationRequestToHMI(application, + application_manager_); } void RegisterAppInterfaceRequest::SendOnAppRegisteredNotificationToHMI( @@ -621,8 +617,7 @@ void RegisterAppInterfaceRequest::SendOnAppRegisteredNotificationToHMI( } std::vector<std::string> request_types = - GetPolicyHandler().GetAppRequestTypes( - application_impl.policy_app_id()); + GetPolicyHandler().GetAppRequestTypes(application_impl.policy_app_id()); application[strings::request_type] = SmartObject(SmartType_Array); smart_objects::SmartObject& request_array = @@ -638,8 +633,7 @@ void RegisterAppInterfaceRequest::SendOnAppRegisteredNotificationToHMI( application[strings::device_info] = SmartObject(SmartType_Map); smart_objects::SmartObject& device_info = application[strings::device_info]; const protocol_handler::SessionObserver& session_observer = - application_manager_.connection_handler() - .get_session_observer(); + application_manager_.connection_handler().get_session_observer(); std::string device_name; std::string mac_address; std::string transport_type; @@ -660,8 +654,7 @@ void RegisterAppInterfaceRequest::SendOnAppRegisteredNotificationToHMI( policy::DeviceConsent::kDeviceAllowed == device_consent; device_info[strings::transport_type] = - application_manager_.GetDeviceTransportType( - transport_type); + application_manager_.GetDeviceTransportType(transport_type); DCHECK(application_manager_.ManageHMICommand(notification)); } @@ -1006,7 +999,8 @@ void RegisterAppInterfaceRequest::SendSubscribeCustomButtonNotification() { CreateHMINotification(FunctionID::Buttons_OnButtonSubscription, msg_params); } -policy::PolicyHandlerInterface& RegisterAppInterfaceRequest::GetPolicyHandler() { +policy::PolicyHandlerInterface& +RegisterAppInterfaceRequest::GetPolicyHandler() { return application_manager_.GetPolicyHandler(); } diff --git a/src/components/application_manager/src/commands/mobile/register_app_interface_response.cc b/src/components/application_manager/src/commands/mobile/register_app_interface_response.cc index 576f842bf7..1d7f829a68 100644 --- a/src/components/application_manager/src/commands/mobile/register_app_interface_response.cc +++ b/src/components/application_manager/src/commands/mobile/register_app_interface_response.cc @@ -61,13 +61,14 @@ void RegisterAppInterfaceResponse::Run() { SendResponse(success, result_code, last_message); - if (mobile_apis::Result::SUCCESS != result_code) { return; } + if (mobile_apis::Result::SUCCESS != result_code) { + return; + } // Add registered application to the policy db right after response sent to // mobile to be able to check all other API according to app permissions application_manager::ApplicationSharedPtr application = - application_manager_.application( - connection_key()); + application_manager_.application(connection_key()); if (!application) { LOG4CXX_ERROR(logger_, "Application with connection key " << connection_key() @@ -83,7 +84,8 @@ void RegisterAppInterfaceResponse::Run() { // Sends OnPermissionChange notification to mobile right after RAI response // and HMI level set-up - application_manager_.GetPolicyHandler().OnAppRegisteredOnMobile(application->policy_app_id()); + application_manager_.GetPolicyHandler().OnAppRegisteredOnMobile( + application->policy_app_id()); } void RegisterAppInterfaceResponse::SetHeartBeatTimeout( @@ -94,8 +96,8 @@ void RegisterAppInterfaceResponse::SetHeartBeatTimeout( if (policy_handler.PolicyEnabled()) { const uint32_t timeout = policy_handler.HeartBeatTimeout(mobile_app_id); if (timeout > 0) { - application_manager_.connection_handler() - .SetHeartBeatTimeout(connection_key, timeout); + application_manager_.connection_handler().SetHeartBeatTimeout( + connection_key, timeout); } } else { LOG4CXX_INFO(logger_, "Policy is turn off"); diff --git a/src/components/application_manager/src/commands/mobile/reset_global_properties_request.cc b/src/components/application_manager/src/commands/mobile/reset_global_properties_request.cc index d394370658..e47ed01f51 100644 --- a/src/components/application_manager/src/commands/mobile/reset_global_properties_request.cc +++ b/src/components/application_manager/src/commands/mobile/reset_global_properties_request.cc @@ -44,23 +44,22 @@ namespace application_manager { namespace commands { ResetGlobalPropertiesRequest::ResetGlobalPropertiesRequest( - const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager), - is_ui_send_(false), - is_tts_send_(false), - is_ui_received_(false), - is_tts_received_(false), - ui_result_(hmi_apis::Common_Result::INVALID_ENUM), - tts_result_(hmi_apis::Common_Result::INVALID_ENUM) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : CommandRequestImpl(message, application_manager) + , is_ui_send_(false) + , is_tts_send_(false) + , is_ui_received_(false) + , is_tts_received_(false) + , ui_result_(hmi_apis::Common_Result::INVALID_ENUM) + , tts_result_(hmi_apis::Common_Result::INVALID_ENUM) {} -ResetGlobalPropertiesRequest::~ResetGlobalPropertiesRequest() { -} +ResetGlobalPropertiesRequest::~ResetGlobalPropertiesRequest() {} void ResetGlobalPropertiesRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); - uint32_t app_id = (*message_)[strings::params][strings::connection_key].asUInt(); + uint32_t app_id = + (*message_)[strings::params][strings::connection_key].asUInt(); ApplicationSharedPtr app = application_manager_.application(app_id); if (!app) { @@ -69,13 +68,12 @@ void ResetGlobalPropertiesRequest::Run() { return; } - size_t obj_length = (*message_)[strings::msg_params][strings::properties] - .length(); - //if application waits for sending ttsGlobalProperties need to remove this - //application from tts_global_properties_app_list_ + size_t obj_length = + (*message_)[strings::msg_params][strings::properties].length(); + // if application waits for sending ttsGlobalProperties need to remove this + // application from tts_global_properties_app_list_ LOG4CXX_INFO(logger_, "RemoveAppFromTTSGlobalPropertiesList"); - application_manager_.RemoveAppFromTTSGlobalPropertiesList( - app_id); + application_manager_.RemoveAppFromTTSGlobalPropertiesList(app_id); bool helpt_promt = false; bool timeout_prompt = false; @@ -96,20 +94,23 @@ void ResetGlobalPropertiesRequest::Run() { } else if (mobile_apis::GlobalProperty::TIMEOUTPROMPT == global_property) { timeout_prompt = ResetTimeoutPromt(app); } else if (((mobile_apis::GlobalProperty::VRHELPTITLE == global_property) || - (mobile_apis::GlobalProperty::VRHELPITEMS == global_property)) && - (0 == number_of_reset_vr)) { + (mobile_apis::GlobalProperty::VRHELPITEMS == + global_property)) && + (0 == number_of_reset_vr)) { ++number_of_reset_vr; vr_help_title_items = ResetVrHelpTitleItems(app); } else if (mobile_apis::GlobalProperty::MENUNAME == global_property) { menu_name = true; } else if (mobile_apis::GlobalProperty::MENUICON == global_property) { menu_icon = true; - } else if (mobile_apis::GlobalProperty::KEYBOARDPROPERTIES == global_property) { + } else if (mobile_apis::GlobalProperty::KEYBOARDPROPERTIES == + global_property) { is_key_board_properties = true; } } - if (vr_help_title_items || menu_name || menu_icon || is_key_board_properties) { + if (vr_help_title_items || menu_name || menu_icon || + is_key_board_properties) { is_ui_send_ = true; } @@ -119,13 +120,14 @@ void ResetGlobalPropertiesRequest::Run() { app->set_reset_global_properties_active(true); - if (vr_help_title_items || menu_name || menu_icon || is_key_board_properties) { - - smart_objects::SmartObject msg_params = smart_objects::SmartObject( - smart_objects::SmartType_Map); + if (vr_help_title_items || menu_name || menu_icon || + is_key_board_properties) { + smart_objects::SmartObject msg_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); if (vr_help_title_items) { - smart_objects::SmartObjectSPtr vr_help = MessageHelper::CreateAppVrHelp(app); + smart_objects::SmartObjectSPtr vr_help = + MessageHelper::CreateAppVrHelp(app); if (!vr_help) { return; } @@ -135,19 +137,20 @@ void ResetGlobalPropertiesRequest::Run() { msg_params[hmi_request::menu_title] = ""; app->set_menu_title(msg_params[hmi_request::menu_title]); } - //TODO(DT): clarify the sending parameter menuIcon - //if (menu_icon) { + // TODO(DT): clarify the sending parameter menuIcon + // if (menu_icon) { //} if (is_key_board_properties) { - smart_objects::SmartObject key_board_properties = smart_objects:: - SmartObject(smart_objects::SmartType_Map); - key_board_properties[strings::language] = static_cast<int32_t> - (hmi_apis::Common_Language::EN_US); - key_board_properties[hmi_request::keyboard_layout] = static_cast<int32_t> - (hmi_apis::Common_KeyboardLayout::QWERTY); + smart_objects::SmartObject key_board_properties = + smart_objects::SmartObject(smart_objects::SmartType_Map); + key_board_properties[strings::language] = + static_cast<int32_t>(hmi_apis::Common_Language::EN_US); + key_board_properties[hmi_request::keyboard_layout] = + static_cast<int32_t>(hmi_apis::Common_KeyboardLayout::QWERTY); // Look for APPLINK-4432 for details. - /*smart_objects::SmartObject limited_character_list = smart_objects::SmartObject( + /*smart_objects::SmartObject limited_character_list = + smart_objects::SmartObject( smart_objects::SmartType_Array); limited_character_list[0] = ""; key_board_properties[hmi_request::limited_character_list] = @@ -158,14 +161,14 @@ void ResetGlobalPropertiesRequest::Run() { } msg_params[strings::app_id] = app->app_id(); - SendHMIRequest(hmi_apis::FunctionID::UI_SetGlobalProperties, - &msg_params, true); + SendHMIRequest( + hmi_apis::FunctionID::UI_SetGlobalProperties, &msg_params, true); } if (timeout_prompt || helpt_promt) { // create ui request - smart_objects::SmartObject msg_params = smart_objects::SmartObject( - smart_objects::SmartType_Map); + smart_objects::SmartObject msg_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); if (helpt_promt) { msg_params[strings::help_prompt] = (*app->help_prompt()); @@ -177,8 +180,8 @@ void ResetGlobalPropertiesRequest::Run() { msg_params[strings::app_id] = app->app_id(); - SendHMIRequest(hmi_apis::FunctionID::TTS_SetGlobalProperties, - &msg_params, true); + SendHMIRequest( + hmi_apis::FunctionID::TTS_SetGlobalProperties, &msg_params, true); } } @@ -189,8 +192,8 @@ bool ResetGlobalPropertiesRequest::ResetHelpPromt( SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return false; } - smart_objects::SmartObject so_help_prompt = smart_objects::SmartObject( - smart_objects::SmartType_Array); + smart_objects::SmartObject so_help_prompt = + smart_objects::SmartObject(smart_objects::SmartType_Array); app->set_help_prompt(so_help_prompt); return true; } @@ -206,12 +209,12 @@ bool ResetGlobalPropertiesRequest::ResetTimeoutPromt( const std::vector<std::string>& time_out_promt = application_manager_.get_settings().time_out_promt(); - smart_objects::SmartObject so_time_out_promt = smart_objects::SmartObject( - smart_objects::SmartType_Array); + smart_objects::SmartObject so_time_out_promt = + smart_objects::SmartObject(smart_objects::SmartType_Array); for (uint32_t i = 0; i < time_out_promt.size(); ++i) { - smart_objects::SmartObject timeoutPrompt = smart_objects::SmartObject( - smart_objects::SmartType_Map); + smart_objects::SmartObject timeoutPrompt = + smart_objects::SmartObject(smart_objects::SmartType_Map); timeoutPrompt[strings::text] = time_out_promt[i]; timeoutPrompt[strings::type] = hmi_apis::Common_SpeechCapabilities::SC_TEXT; so_time_out_promt[i] = timeoutPrompt; @@ -243,34 +246,35 @@ void ResetGlobalPropertiesRequest::on_event(const event_engine::Event& event) { application_manager_.application(connection_key()); switch (event.id()) { - case hmi_apis::FunctionID::UI_SetGlobalProperties: { - LOG4CXX_INFO(logger_, "Received UI_SetGlobalProperties event"); - is_ui_received_ = true; - ui_result_ = static_cast<hmi_apis::Common_Result::eType>( - message[strings::params][hmi_response::code].asInt()); - break; - } - case hmi_apis::FunctionID::TTS_SetGlobalProperties: { - LOG4CXX_INFO(logger_, "Received TTS_SetGlobalProperties event"); - is_tts_received_ = true; - tts_result_ = static_cast<hmi_apis::Common_Result::eType>( - message[strings::params][hmi_response::code].asInt()); - break; - } - default: { - LOG4CXX_ERROR(logger_, "Received unknown event" << event.id()); - return; - } + case hmi_apis::FunctionID::UI_SetGlobalProperties: { + LOG4CXX_INFO(logger_, "Received UI_SetGlobalProperties event"); + is_ui_received_ = true; + ui_result_ = static_cast<hmi_apis::Common_Result::eType>( + message[strings::params][hmi_response::code].asInt()); + break; + } + case hmi_apis::FunctionID::TTS_SetGlobalProperties: { + LOG4CXX_INFO(logger_, "Received TTS_SetGlobalProperties event"); + is_tts_received_ = true; + tts_result_ = static_cast<hmi_apis::Common_Result::eType>( + message[strings::params][hmi_response::code].asInt()); + break; + } + default: { + LOG4CXX_ERROR(logger_, "Received unknown event" << event.id()); + return; + } } if (!IsPendingResponseExist()) { - bool result = ((hmi_apis::Common_Result::SUCCESS == ui_result_) - && (hmi_apis::Common_Result::SUCCESS == tts_result_ || - hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == tts_result_)) - || ((hmi_apis::Common_Result::SUCCESS == ui_result_) - && (hmi_apis::Common_Result::INVALID_ENUM == tts_result_)) - || ((hmi_apis::Common_Result::INVALID_ENUM == ui_result_) - && (hmi_apis::Common_Result::SUCCESS == tts_result_)); + bool result = + ((hmi_apis::Common_Result::SUCCESS == ui_result_) && + (hmi_apis::Common_Result::SUCCESS == tts_result_ || + hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == tts_result_)) || + ((hmi_apis::Common_Result::SUCCESS == ui_result_) && + (hmi_apis::Common_Result::INVALID_ENUM == tts_result_)) || + ((hmi_apis::Common_Result::INVALID_ENUM == ui_result_) && + (hmi_apis::Common_Result::SUCCESS == tts_result_)); mobile_apis::Result::eType result_code; const char* return_info = NULL; @@ -278,18 +282,21 @@ void ResetGlobalPropertiesRequest::on_event(const event_engine::Event& event) { if (result) { if (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == tts_result_) { result_code = mobile_apis::Result::WARNINGS; - return_info = std::string("Unsupported phoneme type sent in a prompt").c_str(); + return_info = + std::string("Unsupported phoneme type sent in a prompt").c_str(); } else { result_code = static_cast<mobile_apis::Result::eType>( - std::max(ui_result_, tts_result_)); + std::max(ui_result_, tts_result_)); } } else { result_code = static_cast<mobile_apis::Result::eType>( - std::max(ui_result_, tts_result_)); + std::max(ui_result_, tts_result_)); } - SendResponse(result, static_cast<mobile_apis::Result::eType>(result_code), - return_info, &(message[strings::msg_params])); + SendResponse(result, + static_cast<mobile_apis::Result::eType>(result_code), + return_info, + &(message[strings::msg_params])); if (!application) { LOG4CXX_ERROR(logger_, "NULL pointer"); @@ -304,7 +311,6 @@ void ResetGlobalPropertiesRequest::on_event(const event_engine::Event& event) { } } - bool ResetGlobalPropertiesRequest::IsPendingResponseExist() { return is_ui_send_ != is_ui_received_ || is_tts_send_ != is_tts_received_; } diff --git a/src/components/application_manager/src/commands/mobile/reset_global_properties_response.cc b/src/components/application_manager/src/commands/mobile/reset_global_properties_response.cc index 6892543d78..c621977868 100644 --- a/src/components/application_manager/src/commands/mobile/reset_global_properties_response.cc +++ b/src/components/application_manager/src/commands/mobile/reset_global_properties_response.cc @@ -33,18 +33,15 @@ #include "application_manager/commands/mobile/reset_global_properties_response.h" - namespace application_manager { namespace commands { ResetGlobalPropertiesResponse::ResetGlobalPropertiesResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} + : CommandResponseImpl(message, application_manager) {} -ResetGlobalPropertiesResponse::~ResetGlobalPropertiesResponse() { -} +ResetGlobalPropertiesResponse::~ResetGlobalPropertiesResponse() {} void ResetGlobalPropertiesResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/scrollable_message_request.cc b/src/components/application_manager/src/commands/mobile/scrollable_message_request.cc index 6366ccefdc..89bd43fcd6 100644 --- a/src/components/application_manager/src/commands/mobile/scrollable_message_request.cc +++ b/src/components/application_manager/src/commands/mobile/scrollable_message_request.cc @@ -47,15 +47,13 @@ namespace commands { ScrollableMessageRequest::ScrollableMessageRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager) { + : CommandRequestImpl(message, application_manager) { subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout); } -ScrollableMessageRequest::~ScrollableMessageRequest() { -} +ScrollableMessageRequest::~ScrollableMessageRequest() {} bool ScrollableMessageRequest::Init() { - /* Timeout in milliseconds. If omitted a standard value of 10000 milliseconds is used.*/ if ((*message_)[strings::msg_params].keyExists(strings::timeout)) { @@ -80,11 +78,13 @@ void ScrollableMessageRequest::Run() { return; } - //ProcessSoftButtons checks strings on the contents incorrect character + // ProcessSoftButtons checks strings on the contents incorrect character mobile_apis::Result::eType processing_result = - MessageHelper::ProcessSoftButtons((*message_)[strings::msg_params], app, - application_manager_.GetPolicyHandler(), application_manager_); + MessageHelper::ProcessSoftButtons((*message_)[strings::msg_params], + app, + application_manager_.GetPolicyHandler(), + application_manager_); if (mobile_apis::Result::SUCCESS != processing_result) { LOG4CXX_ERROR(logger_, "Wrong soft buttons parameters!"); @@ -92,11 +92,12 @@ void ScrollableMessageRequest::Run() { return; } - smart_objects::SmartObject msg_params = smart_objects::SmartObject( - smart_objects::SmartType_Map); + smart_objects::SmartObject msg_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); msg_params[hmi_request::message_text][hmi_request::field_name] = - static_cast<int32_t>(hmi_apis::Common_TextFieldName::scrollableMessageBody); + static_cast<int32_t>( + hmi_apis::Common_TextFieldName::scrollableMessageBody); msg_params[hmi_request::message_text][hmi_request::field_text] = (*message_)[strings::msg_params][strings::scroll_message_body]; msg_params[strings::app_id] = app->app_id(); @@ -120,26 +121,24 @@ void ScrollableMessageRequest::on_event(const event_engine::Event& event) { switch (event.id()) { case hmi_apis::FunctionID::UI_OnResetTimeout: { LOG4CXX_INFO(logger_, "Received UI_OnResetTimeout event"); - application_manager_.updateRequestTimeout(connection_key(), - correlation_id(), - default_timeout()); + application_manager_.updateRequestTimeout( + connection_key(), correlation_id(), default_timeout()); break; } case hmi_apis::FunctionID::UI_ScrollableMessage: { LOG4CXX_INFO(logger_, "Received UI_ScrollableMessage event"); mobile_apis::Result::eType result_code = - static_cast<mobile_apis::Result::eType> - (message[strings::params][hmi_response::code].asInt()); + static_cast<mobile_apis::Result::eType>( + message[strings::params][hmi_response::code].asInt()); HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities(); - bool result = - Compare<mobile_api::Result::eType, EQ, ONE>( - result_code, - mobile_api::Result::SUCCESS, - mobile_api::Result::WARNINGS); + bool result = Compare<mobile_api::Result::eType, EQ, ONE>( + result_code, + mobile_api::Result::SUCCESS, + mobile_api::Result::WARNINGS); if (mobile_apis::Result::UNSUPPORTED_RESOURCE == result_code && hmi_capabilities.is_ui_cooperating()) { @@ -150,7 +149,7 @@ void ScrollableMessageRequest::on_event(const event_engine::Event& event) { break; } default: { - LOG4CXX_ERROR(logger_,"Received unknown event" << event.id()); + LOG4CXX_ERROR(logger_, "Received unknown event" << event.id()); break; } } @@ -158,4 +157,3 @@ void ScrollableMessageRequest::on_event(const event_engine::Event& event) { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/mobile/scrollable_message_response.cc b/src/components/application_manager/src/commands/mobile/scrollable_message_response.cc index ccc8bafbb0..a5b16bdb70 100644 --- a/src/components/application_manager/src/commands/mobile/scrollable_message_response.cc +++ b/src/components/application_manager/src/commands/mobile/scrollable_message_response.cc @@ -41,17 +41,16 @@ namespace application_manager { namespace commands { ScrollableMessageResponse::ScrollableMessageResponse( - const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : CommandResponseImpl(message, application_manager) {} void ScrollableMessageResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); - mobile_apis::Result::eType result_code = static_cast<mobile_apis::Result::eType>( - (*message_)[strings::msg_params][strings::result_code].asInt()); - ApplicationSharedPtr application = - application_manager_.application( - (*message_)[strings::params][strings::connection_key].asInt()); + mobile_apis::Result::eType result_code = + static_cast<mobile_apis::Result::eType>( + (*message_)[strings::msg_params][strings::result_code].asInt()); + ApplicationSharedPtr application = application_manager_.application( + (*message_)[strings::params][strings::connection_key].asInt()); if ((mobile_apis::Result::REJECTED != result_code) && application) { application->UnsubscribeFromSoftButtons( (*message_)[strings::params][strings::function_id].asInt()); diff --git a/src/components/application_manager/src/commands/mobile/send_location_request.cc b/src/components/application_manager/src/commands/mobile/send_location_request.cc index 9237b59ee9..8225e8081f 100644 --- a/src/components/application_manager/src/commands/mobile/send_location_request.cc +++ b/src/components/application_manager/src/commands/mobile/send_location_request.cc @@ -40,12 +40,11 @@ namespace application_manager { namespace commands { -SendLocationRequest::SendLocationRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager) { -} +SendLocationRequest::SendLocationRequest( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : CommandRequestImpl(message, application_manager) {} -SendLocationRequest::~SendLocationRequest() { -} +SendLocationRequest::~SendLocationRequest() {} void SendLocationRequest::Run() { using namespace hmi_apis; @@ -56,8 +55,8 @@ void SendLocationRequest::Run() { if (!app) { LOG4CXX_ERROR(logger_, - "An application with connection key " << connection_key() - << " is not registered."); + "An application with connection key " + << connection_key() << " is not registered."); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } @@ -83,7 +82,6 @@ void SendLocationRequest::Run() { return; } - if (IsWhiteSpaceExist()) { LOG4CXX_ERROR(logger_, "Strings contain invalid characters"); SendResponse(false, mobile_apis::Result::INVALID_DATA); @@ -94,21 +92,23 @@ void SendLocationRequest::Run() { const utils::custom_string::CustomString& address = msg_params[strings::address].asCustomString(); if (address.empty()) { - msg_params.erase(strings::address); + msg_params.erase(strings::address); } } - if (!CheckFieldsCompatibility()){ - LOG4CXX_ERROR(logger_, "CheckFieldsCompatibility failed"); - SendResponse(false, mobile_apis::Result::INVALID_DATA); - return; + if (!CheckFieldsCompatibility()) { + LOG4CXX_ERROR(logger_, "CheckFieldsCompatibility failed"); + SendResponse(false, mobile_apis::Result::INVALID_DATA); + return; } if (msg_params.keyExists(strings::location_image)) { mobile_apis::Result::eType verification_result = mobile_apis::Result::SUCCESS; verification_result = MessageHelper::VerifyImage( - (*message_)[strings::msg_params][strings::location_image], app, application_manager_); + (*message_)[strings::msg_params][strings::location_image], + app, + application_manager_); if (mobile_apis::Result::SUCCESS != verification_result) { LOG4CXX_ERROR(logger_, "VerifyImage INVALID_DATA!"); SendResponse(false, verification_result); @@ -116,13 +116,11 @@ void SendLocationRequest::Run() { } } - - SmartObject request_msg_params = SmartObject( - smart_objects::SmartType_Map); + SmartObject request_msg_params = SmartObject(smart_objects::SmartType_Map); request_msg_params = msg_params; request_msg_params[strings::app_id] = app->hmi_app_id(); - SendHMIRequest(hmi_apis::FunctionID::Navigation_SendLocation, - &request_msg_params, true); + SendHMIRequest( + hmi_apis::FunctionID::Navigation_SendLocation, &request_msg_params, true); } void SendLocationRequest::on_event(const event_engine::Event& event) { @@ -148,7 +146,8 @@ void SendLocationRequest::on_event(const event_engine::Event& event) { } bool SendLocationRequest::CheckFieldsCompatibility() { - const smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params]; + const smart_objects::SmartObject& msg_params = + (*message_)[strings::msg_params]; MessageHelper::PrintSmartObject(msg_params); const bool longitude_degrees_exist = msg_params.keyExists(strings::longitude_degrees); @@ -157,22 +156,25 @@ bool SendLocationRequest::CheckFieldsCompatibility() { const bool address_exist = msg_params.keyExists(strings::address); if (latitude_degrees_exist ^ longitude_degrees_exist) { - LOG4CXX_DEBUG(logger_, "latitude and longitude should be provided only in pair"); + LOG4CXX_DEBUG(logger_, + "latitude and longitude should be provided only in pair"); return false; } if (!address_exist && !longitude_degrees_exist && !latitude_degrees_exist) { - LOG4CXX_DEBUG(logger_, "address or latitude/longtitude should should be provided"); + LOG4CXX_DEBUG(logger_, + "address or latitude/longtitude should should be provided"); return false; } return true; } -void insert_if_contains(const smart_objects::SmartObject& msg_params, - const std::string& param_key, - std::vector<utils::custom_string::CustomString>& output_vector) { - if (msg_params.keyExists(param_key)) { - output_vector.push_back(msg_params[param_key].asCustomString()); - } +void insert_if_contains( + const smart_objects::SmartObject& msg_params, + const std::string& param_key, + std::vector<utils::custom_string::CustomString>& output_vector) { + if (msg_params.keyExists(param_key)) { + output_vector.push_back(msg_params[param_key].asCustomString()); + } } bool SendLocationRequest::IsWhiteSpaceExist() { @@ -222,15 +224,17 @@ bool SendLocationRequest::IsWhiteSpaceExist() { return false; } -bool SendLocationRequest::CheckHMICapabilities(std::list<hmi_apis::Common_TextFieldName::eType>& fields_names) { - LOG4CXX_AUTO_TRACE(logger_); +bool SendLocationRequest::CheckHMICapabilities( + std::list<hmi_apis::Common_TextFieldName::eType>& fields_names) { + LOG4CXX_AUTO_TRACE(logger_); using namespace smart_objects; using namespace hmi_apis; if (fields_names.empty()) { return true; } - const HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities(); + const HMICapabilities& hmi_capabilities = + application_manager_.hmi_capabilities(); if (!hmi_capabilities.is_ui_cooperating()) { LOG4CXX_ERROR(logger_, "UI is not supported."); return false; @@ -238,12 +242,14 @@ bool SendLocationRequest::CheckHMICapabilities(std::list<hmi_apis::Common_TextFi if (hmi_capabilities.display_capabilities()) { const SmartObject disp_cap = (*hmi_capabilities.display_capabilities()); - const SmartObject& text_fields = disp_cap.getElement(hmi_response::text_fields); + const SmartObject& text_fields = + disp_cap.getElement(hmi_response::text_fields); const size_t len = text_fields.length(); for (size_t i = 0; i < len; ++i) { const SmartObject& text_field = text_fields[i]; const Common_TextFieldName::eType filed_name = - static_cast<Common_TextFieldName::eType>(text_field.getElement(strings::name).asInt()); + static_cast<Common_TextFieldName::eType>( + text_field.getElement(strings::name).asInt()); const std::list<Common_TextFieldName::eType>::iterator it = std::find(fields_names.begin(), fields_names.end(), filed_name); if (it != fields_names.end()) { diff --git a/src/components/application_manager/src/commands/mobile/send_location_response.cc b/src/components/application_manager/src/commands/mobile/send_location_response.cc index 756dfc16db..167642e390 100644 --- a/src/components/application_manager/src/commands/mobile/send_location_response.cc +++ b/src/components/application_manager/src/commands/mobile/send_location_response.cc @@ -40,12 +40,11 @@ namespace application_manager { namespace commands { -SendLocationResponse::SendLocationResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} +SendLocationResponse::SendLocationResponse( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : CommandResponseImpl(message, application_manager) {} -SendLocationResponse::~SendLocationResponse() { -} +SendLocationResponse::~SendLocationResponse() {} void SendLocationResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc b/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc index cbacbef612..40b708e30d 100644 --- a/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc +++ b/src/components/application_manager/src/commands/mobile/set_app_icon_request.cc @@ -44,12 +44,14 @@ namespace application_manager { namespace commands { -SetAppIconRequest::SetAppIconRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) +SetAppIconRequest::SetAppIconRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager) : CommandRequestImpl(message, application_manager) - , is_icons_saving_enabled_(false){ - const std::string path = application_manager_.get_settings().app_icons_folder(); - is_icons_saving_enabled_ = file_system::IsWritingAllowed(path) && - file_system::IsReadingAllowed(path); + , is_icons_saving_enabled_(false) { + const std::string path = + application_manager_.get_settings().app_icons_folder(); + is_icons_saving_enabled_ = file_system::IsWritingAllowed(path) && + file_system::IsReadingAllowed(path); } SetAppIconRequest::~SetAppIconRequest() {} @@ -57,8 +59,7 @@ SetAppIconRequest::~SetAppIconRequest() {} void SetAppIconRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); - ApplicationSharedPtr app = - application_manager_.application(connection_key()); + ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { LOG4CXX_ERROR(logger_, "Application is not registered"); @@ -111,7 +112,9 @@ void SetAppIconRequest::Run() { void SetAppIconRequest::CopyToIconStorage( const std::string& path_to_file) const { - if (!application_manager_.protocol_handler().get_settings().enable_protocol_4()) { + if (!application_manager_.protocol_handler() + .get_settings() + .enable_protocol_4()) { LOG4CXX_WARN(logger_, "Icon copying skipped, since protocol ver. 4 is not enabled."); return; @@ -133,9 +136,8 @@ void SetAppIconRequest::CopyToIconStorage( LOG4CXX_ERROR(logger_, "Icon size (" << file_size << ") is bigger, than " " icons storage maximum size (" - << storage_max_size - << ")." - "Copying skipped."); + << storage_max_size << ")." + "Copying skipped."); return; } @@ -236,11 +238,10 @@ void SetAppIconRequest::on_event(const event_engine::Event& event) { static_cast<mobile_apis::Result::eType>( message[strings::params][hmi_response::code].asInt()); - const bool result = - Compare<mobile_api::Result::eType, EQ, ONE>( - result_code, - mobile_api::Result::SUCCESS, - mobile_api::Result::WARNINGS); + const bool result = Compare<mobile_api::Result::eType, EQ, ONE>( + result_code, + mobile_api::Result::SUCCESS, + mobile_api::Result::WARNINGS); if (result) { ApplicationSharedPtr app = @@ -251,9 +252,9 @@ void SetAppIconRequest::on_event(const event_engine::Event& event) { return; } - const std::string& path = (*message_)[strings::msg_params] - [strings::sync_file_name] - [strings::value].asString(); + const std::string& path = + (*message_)[strings::msg_params][strings::sync_file_name] + [strings::value].asString(); app->set_app_icon_path(path); LOG4CXX_INFO(logger_, diff --git a/src/components/application_manager/src/commands/mobile/set_app_icon_response.cc b/src/components/application_manager/src/commands/mobile/set_app_icon_response.cc index 53d9fd9ea6..29f3950ffc 100644 --- a/src/components/application_manager/src/commands/mobile/set_app_icon_response.cc +++ b/src/components/application_manager/src/commands/mobile/set_app_icon_response.cc @@ -33,17 +33,15 @@ #include "application_manager/commands/mobile/set_app_icon_response.h" - namespace application_manager { namespace commands { -SetAppIconResponse::SetAppIconResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} +SetAppIconResponse::SetAppIconResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : CommandResponseImpl(message, application_manager) {} -SetAppIconResponse::~SetAppIconResponse() { -} +SetAppIconResponse::~SetAppIconResponse() {} void SetAppIconResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/set_display_layout_request.cc b/src/components/application_manager/src/commands/mobile/set_display_layout_request.cc index dfca103b35..6cb6318791 100644 --- a/src/components/application_manager/src/commands/mobile/set_display_layout_request.cc +++ b/src/components/application_manager/src/commands/mobile/set_display_layout_request.cc @@ -35,18 +35,15 @@ #include "application_manager/application_impl.h" - namespace application_manager { namespace commands { SetDisplayLayoutRequest::SetDisplayLayoutRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager) { -} + : CommandRequestImpl(message, application_manager) {} -SetDisplayLayoutRequest::~SetDisplayLayoutRequest() { -} +SetDisplayLayoutRequest::~SetDisplayLayoutRequest() {} void SetDisplayLayoutRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -61,8 +58,8 @@ void SetDisplayLayoutRequest::Run() { (*message_)[strings::msg_params][strings::app_id] = app->app_id(); SendHMIRequest(hmi_apis::FunctionID::UI_SetDisplayLayout, - &((*message_)[strings::msg_params]), true); - + &((*message_)[strings::msg_params]), + true); } void SetDisplayLayoutRequest::on_event(const event_engine::Event& event) { @@ -74,8 +71,8 @@ void SetDisplayLayoutRequest::on_event(const event_engine::Event& event) { LOG4CXX_INFO(logger_, "Received UI_SetDisplayLayout event"); mobile_apis::Result::eType result_code = - static_cast<mobile_apis::Result::eType>( - message[strings::params][hmi_response::code].asInt()); + static_cast<mobile_apis::Result::eType>( + message[strings::params][hmi_response::code].asInt()); bool response_success = mobile_apis::Result::SUCCESS == result_code; smart_objects::SmartObject msg_params = message[strings::msg_params]; @@ -86,9 +83,13 @@ 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()) { - msg_params[hmi_response::display_capabilities][hmi_response::templates_available] = - hmi_capabilities.display_capabilities()->getElement(hmi_response::templates_available); + 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( + hmi_response::templates_available); } } } @@ -96,7 +97,7 @@ void SetDisplayLayoutRequest::on_event(const event_engine::Event& event) { break; } default: { - LOG4CXX_ERROR(logger_,"Received unknown event" << event.id()); + LOG4CXX_ERROR(logger_, "Received unknown event" << event.id()); return; } } diff --git a/src/components/application_manager/src/commands/mobile/set_display_layout_response.cc b/src/components/application_manager/src/commands/mobile/set_display_layout_response.cc index 02a03b7b07..b5e53803c8 100644 --- a/src/components/application_manager/src/commands/mobile/set_display_layout_response.cc +++ b/src/components/application_manager/src/commands/mobile/set_display_layout_response.cc @@ -34,24 +34,20 @@ #include "application_manager/commands/mobile/set_display_layout_response.h" #include "application_manager/application_impl.h" - namespace application_manager { namespace commands { SetDisplayLayoutResponse::SetDisplayLayoutResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} + : CommandResponseImpl(message, application_manager) {} -SetDisplayLayoutResponse::~SetDisplayLayoutResponse() { -} +SetDisplayLayoutResponse::~SetDisplayLayoutResponse() {} void SetDisplayLayoutResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); application_manager_.SendMessageToMobile(message_); - } } // namespace commands diff --git a/src/components/application_manager/src/commands/mobile/set_global_properties_request.cc b/src/components/application_manager/src/commands/mobile/set_global_properties_request.cc index f74e8a923c..171b902df1 100644 --- a/src/components/application_manager/src/commands/mobile/set_global_properties_request.cc +++ b/src/components/application_manager/src/commands/mobile/set_global_properties_request.cc @@ -45,17 +45,15 @@ namespace commands { SetGlobalPropertiesRequest::SetGlobalPropertiesRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager), - is_ui_send_(false), - is_tts_send_(false), - is_ui_received_(false), - is_tts_received_(false), - ui_result_(hmi_apis::Common_Result::INVALID_ENUM), - tts_result_(hmi_apis::Common_Result::INVALID_ENUM) { -} + : CommandRequestImpl(message, application_manager) + , is_ui_send_(false) + , is_tts_send_(false) + , is_ui_received_(false) + , is_tts_received_(false) + , ui_result_(hmi_apis::Common_Result::INVALID_ENUM) + , tts_result_(hmi_apis::Common_Result::INVALID_ENUM) {} -SetGlobalPropertiesRequest::~SetGlobalPropertiesRequest() { -} +SetGlobalPropertiesRequest::~SetGlobalPropertiesRequest() {} void SetGlobalPropertiesRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -63,12 +61,12 @@ void SetGlobalPropertiesRequest::Run() { const smart_objects::SmartObject& msg_params = (*message_)[strings::msg_params]; - ApplicationSharedPtr app = - application_manager_.application(connection_key()); + 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; } @@ -84,18 +82,23 @@ void SetGlobalPropertiesRequest::Run() { if ((*message_)[strings::msg_params].keyExists(strings::menu_icon)) { verification_result = MessageHelper::VerifyImage( - (*message_)[strings::msg_params][strings::menu_icon], app, application_manager_); + (*message_)[strings::msg_params][strings::menu_icon], + app, + application_manager_); if (mobile_apis::Result::SUCCESS != verification_result) { - LOG4CXX_ERROR(logger_, "MessageHelper::VerifyImage return " - << verification_result); + LOG4CXX_ERROR( + logger_, "MessageHelper::VerifyImage return " << verification_result); SendResponse(false, verification_result); return; } } // Check for image file(s) in vrHelpItem if ((*message_)[strings::msg_params].keyExists(strings::vr_help)) { - if (mobile_apis::Result::SUCCESS != MessageHelper::VerifyImageVrHelpItems( - (*message_)[strings::msg_params][strings::vr_help], app, application_manager_)) { + if (mobile_apis::Result::SUCCESS != + MessageHelper::VerifyImageVrHelpItems( + (*message_)[strings::msg_params][strings::vr_help], + app, + application_manager_)) { LOG4CXX_ERROR(logger_, "MessageHelper::VerifyImage return INVALID_DATA!"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; @@ -108,19 +111,19 @@ void SetGlobalPropertiesRequest::Run() { return; } - //if application waits for sending ttsGlobalProperties need to remove this - //application from tts_global_properties_app_list_ - application_manager_.RemoveAppFromTTSGlobalPropertiesList( - connection_key()); + // if application waits for sending ttsGlobalProperties need to remove this + // application from tts_global_properties_app_list_ + application_manager_.RemoveAppFromTTSGlobalPropertiesList(connection_key()); bool is_help_prompt_present = msg_params.keyExists(strings::help_prompt); - bool is_timeout_prompt_present = msg_params.keyExists( - strings::timeout_prompt); + bool is_timeout_prompt_present = + msg_params.keyExists(strings::timeout_prompt); bool is_vr_help_title_present = msg_params.keyExists(strings::vr_help_title); bool is_vr_help_present = msg_params.keyExists(strings::vr_help); // check VR params if (is_vr_help_title_present ^ is_vr_help_present) { - LOG4CXX_ERROR(logger_, "Reject because of vr_help or vr_help_title only provided"); + LOG4CXX_ERROR(logger_, + "Reject because of vr_help or vr_help_title only provided"); SendResponse(false, mobile_apis::Result::REJECTED); return; } @@ -129,8 +132,8 @@ void SetGlobalPropertiesRequest::Run() { if (!CheckVrHelpItemsOrder(msg_params[strings::vr_help])) { LOG4CXX_ERROR(logger_, - "VR Help Items contains nonsequential positions" << - " (e.g. [1,2,4]) or not started from 1"); + "VR Help Items contains nonsequential positions" + << " (e.g. [1,2,4]) or not started from 1"); SendResponse(false, mobile_apis::Result::REJECTED); return; } @@ -177,14 +180,12 @@ void SetGlobalPropertiesRequest::Run() { smart_objects::SmartObject(smart_objects::SmartType_Map); if (is_help_prompt_present) { - app->set_help_prompt( - msg_params.getElement(strings::help_prompt)); + app->set_help_prompt(msg_params.getElement(strings::help_prompt)); params[strings::help_prompt] = (*app->help_prompt()); } if (is_timeout_prompt_present) { - app->set_timeout_prompt( - msg_params.getElement(strings::timeout_prompt)); + app->set_timeout_prompt(msg_params.getElement(strings::timeout_prompt)); params[strings::timeout_prompt] = (*app->timeout_prompt()); } @@ -201,11 +202,13 @@ bool SetGlobalPropertiesRequest::CheckVrHelpItemsOrder( DCHECK_OR_RETURN(vr_help_length > 0, false); for (size_t j = 0; j < vr_help_length; ++j) { - const size_t position = vr_help.getElement(j).getElement(strings::position).asUInt(); + const size_t position = + vr_help.getElement(j).getElement(strings::position).asUInt(); // Elements shall start from 1 and increment one by one if (position != (j + 1)) { - LOG4CXX_ERROR(logger_, "VR help items order is wrong" << - " at " << j << ", position value:" << position); + LOG4CXX_ERROR(logger_, + "VR help items order is wrong" + << " at " << j << ", position value:" << position); return false; } } @@ -245,56 +248,51 @@ void SetGlobalPropertiesRequest::on_event(const event_engine::Event& event) { const bool is_tts_succeeded = Compare<hmi_apis::Common_Result::eType, EQ, ONE>( - tts_result_, - hmi_apis::Common_Result::SUCCESS, - hmi_apis::Common_Result::UNSUPPORTED_RESOURCE, - hmi_apis::Common_Result::WARNINGS); + tts_result_, + hmi_apis::Common_Result::SUCCESS, + hmi_apis::Common_Result::UNSUPPORTED_RESOURCE, + hmi_apis::Common_Result::WARNINGS); - const bool is_ui_succeeded = - Compare<hmi_apis::Common_Result::eType, EQ, ONE>( - ui_result_, - hmi_apis::Common_Result::SUCCESS, - hmi_apis::Common_Result::UNSUPPORTED_RESOURCE, - hmi_apis::Common_Result::WARNINGS); + const bool is_ui_succeeded = Compare<hmi_apis::Common_Result::eType, EQ, ONE>( + ui_result_, + hmi_apis::Common_Result::SUCCESS, + hmi_apis::Common_Result::UNSUPPORTED_RESOURCE, + hmi_apis::Common_Result::WARNINGS); const bool is_ui_invalid_unsupported = Compare<hmi_apis::Common_Result::eType, EQ, ONE>( - ui_result_, - hmi_apis::Common_Result::INVALID_ENUM, - hmi_apis::Common_Result::UNSUPPORTED_RESOURCE); + ui_result_, + hmi_apis::Common_Result::INVALID_ENUM, + hmi_apis::Common_Result::UNSUPPORTED_RESOURCE); - bool result = - (is_tts_succeeded && is_ui_succeeded) || - (is_ui_succeeded && - hmi_apis::Common_Result::INVALID_ENUM == tts_result_) || - (is_ui_invalid_unsupported && is_tts_succeeded); + bool result = (is_tts_succeeded && is_ui_succeeded) || + (is_ui_succeeded && + hmi_apis::Common_Result::INVALID_ENUM == tts_result_) || + (is_ui_invalid_unsupported && is_tts_succeeded); mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM; const char* return_info = NULL; const bool is_ui_or_tts_warning = Compare<hmi_apis::Common_Result::eType, EQ, ONE>( - hmi_apis::Common_Result::WARNINGS, - tts_result_, - ui_result_); + hmi_apis::Common_Result::WARNINGS, tts_result_, ui_result_); - if (result && - (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == tts_result_ || - is_ui_or_tts_warning)) { + if (result && (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE == tts_result_ || + is_ui_or_tts_warning)) { result_code = mobile_apis::Result::WARNINGS; return_info = std::string("Unsupported phoneme type sent in a prompt").c_str(); } else { - result_code = MessageHelper::HMIToMobileResult( - std::max(ui_result_, tts_result_)); + result_code = + MessageHelper::HMIToMobileResult(std::max(ui_result_, tts_result_)); } - //TODO{ALeshin} APPLINK-15858. connection_key removed during SendResponse - ApplicationSharedPtr application = - application_manager_.application(connection_key()); + // TODO{ALeshin} APPLINK-15858. connection_key removed during SendResponse + ApplicationSharedPtr application = + application_manager_.application(connection_key()); - SendResponse(result, result_code, return_info, - &(message[strings::msg_params])); + SendResponse( + result, result_code, return_info, &(message[strings::msg_params])); if (!application) { LOG4CXX_DEBUG(logger_, "NULL pointer."); @@ -311,30 +309,28 @@ bool SetGlobalPropertiesRequest::ValidateVRHelpTitle( LOG4CXX_AUTO_TRACE(logger_); if (vr_help_so_ptr) { const std::string& vr_help = vr_help_so_ptr->asString(); - LOG4CXX_TRACE(logger_, "App contains vr_help_title: \"" << vr_help << '"'); + LOG4CXX_TRACE(logger_, "App contains vr_help_title: \"" << vr_help << '"'); return !vr_help.empty(); } return false; } void SetGlobalPropertiesRequest::PrepareUIRequestVRHelpData( - const ApplicationSharedPtr app, const smart_objects::SmartObject &msg_params, - smart_objects::SmartObject &out_params) { + const ApplicationSharedPtr app, + const smart_objects::SmartObject& msg_params, + smart_objects::SmartObject& out_params) { LOG4CXX_AUTO_TRACE(logger_); DCHECK_OR_RETURN_VOID(app); - app->set_vr_help_title( - msg_params.getElement(strings::vr_help_title)); - app->set_vr_help( - msg_params.getElement(strings::vr_help)); + app->set_vr_help_title(msg_params.getElement(strings::vr_help_title)); + app->set_vr_help(msg_params.getElement(strings::vr_help)); out_params[strings::vr_help_title] = (*app->vr_help_title()); out_params[strings::vr_help] = (*app->vr_help()); } bool SetGlobalPropertiesRequest::PrepareUIRequestDefaultVRHelpData( - const ApplicationSharedPtr app, - smart_objects::SmartObject &out_params) { + const ApplicationSharedPtr app, smart_objects::SmartObject& out_params) { LOG4CXX_AUTO_TRACE(logger_); DCHECK_OR_RETURN(app, false); @@ -345,7 +341,8 @@ bool SetGlobalPropertiesRequest::PrepareUIRequestDefaultVRHelpData( int32_t index = 0; smart_objects::SmartObject vr_help_items; for (CommandsMap::const_iterator command_it = cmdMap.begin(); - cmdMap.end() != command_it; ++command_it) { + cmdMap.end() != command_it; + ++command_it) { const smart_objects::SmartObject& command = *command_it->second; if (!command.keyExists(strings::vr_commands)) { LOG4CXX_ERROR(logger_, "VR synonyms are empty"); @@ -368,13 +365,16 @@ bool SetGlobalPropertiesRequest::PrepareUIRequestDefaultVRHelpData( } void SetGlobalPropertiesRequest::PrepareUIRequestMenuAndKeyboardData( - const ApplicationSharedPtr app, const smart_objects::SmartObject &msg_params, - smart_objects::SmartObject &out_params) { + const ApplicationSharedPtr app, + const smart_objects::SmartObject& msg_params, + smart_objects::SmartObject& out_params) { LOG4CXX_AUTO_TRACE(logger_); DCHECK_OR_RETURN_VOID(app); - const bool is_menu_title_present = msg_params.keyExists(hmi_request::menu_title); - const bool is_menu_icon_present = msg_params.keyExists(hmi_request::menu_icon); + const bool is_menu_title_present = + msg_params.keyExists(hmi_request::menu_title); + const bool is_menu_icon_present = + msg_params.keyExists(hmi_request::menu_icon); const bool is_keyboard_props_present = msg_params.keyExists(hmi_request::keyboard_properties); @@ -384,8 +384,7 @@ void SetGlobalPropertiesRequest::PrepareUIRequestMenuAndKeyboardData( app->set_menu_title(msg_params[hmi_request::menu_title]); } if (is_menu_icon_present) { - out_params[hmi_request::menu_icon] = - msg_params[hmi_request::menu_icon]; + out_params[hmi_request::menu_icon] = msg_params[hmi_request::menu_icon]; app->set_menu_icon(msg_params[hmi_request::menu_icon]); } if (is_keyboard_props_present) { @@ -396,18 +395,18 @@ void SetGlobalPropertiesRequest::PrepareUIRequestMenuAndKeyboardData( } void SetGlobalPropertiesRequest::SendTTSRequest( - const smart_objects::SmartObject ¶ms, bool use_events) { + const smart_objects::SmartObject& params, bool use_events) { LOG4CXX_AUTO_TRACE(logger_); - SendHMIRequest(hmi_apis::FunctionID::TTS_SetGlobalProperties, - ¶ms, use_events); + SendHMIRequest( + hmi_apis::FunctionID::TTS_SetGlobalProperties, ¶ms, use_events); is_tts_send_ = true; } void SetGlobalPropertiesRequest::SendUIRequest( - const smart_objects::SmartObject ¶ms, bool use_events) { + const smart_objects::SmartObject& params, bool use_events) { LOG4CXX_AUTO_TRACE(logger_); - SendHMIRequest(hmi_apis::FunctionID::UI_SetGlobalProperties, - ¶ms, use_events); + SendHMIRequest( + hmi_apis::FunctionID::UI_SetGlobalProperties, ¶ms, use_events); is_ui_send_ = true; } @@ -418,13 +417,13 @@ bool SetGlobalPropertiesRequest::IsPendingResponseExist() { bool SetGlobalPropertiesRequest::ValidateConditionalMandatoryParameters( const smart_objects::SmartObject& params) { LOG4CXX_AUTO_TRACE(logger_); - return params.keyExists(strings::help_prompt) - || params.keyExists(strings::timeout_prompt) - || params.keyExists(strings::vr_help_title) - || params.keyExists(strings::vr_help) - || params.keyExists(strings::menu_title) - || params.keyExists(strings::menu_icon) - || params.keyExists(strings::keyboard_properties); + return params.keyExists(strings::help_prompt) || + params.keyExists(strings::timeout_prompt) || + params.keyExists(strings::vr_help_title) || + params.keyExists(strings::vr_help) || + params.keyExists(strings::menu_title) || + params.keyExists(strings::menu_icon) || + params.keyExists(strings::keyboard_properties); } bool SetGlobalPropertiesRequest::IsWhiteSpaceExist() { @@ -484,11 +483,11 @@ bool SetGlobalPropertiesRequest::IsWhiteSpaceExist() { str = (*it_vh)[strings::image][strings::value].asCharArray(); if (!CheckSyntax(str)) { LOG4CXX_ERROR(logger_, - "Invalid vr_help image value syntax check failed"); + "Invalid vr_help image value syntax check failed"); return true; } } // if image exists - } // for - vh_array iteration + } // for - vh_array iteration } if (msg_params.keyExists(strings::menu_icon)) { @@ -515,13 +514,12 @@ bool SetGlobalPropertiesRequest::IsWhiteSpaceExist() { } } - if (msg_params.keyExists(strings::keyboard_properties)) { - if (msg_params[strings::keyboard_properties]. - keyExists(strings::limited_character_list)) { + if (msg_params[strings::keyboard_properties].keyExists( + 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(); @@ -529,21 +527,24 @@ bool SetGlobalPropertiesRequest::IsWhiteSpaceExist() { for (; it_lcl != it_lcl_end; ++it_lcl) { str = (*it_lcl).asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid keyboard_properties " - "limited_character_list syntax check failed"); + LOG4CXX_ERROR(logger_, + "Invalid keyboard_properties " + "limited_character_list syntax check failed"); return true; } } } - if (msg_params[strings::keyboard_properties]. - keyExists(strings::auto_complete_text)) { - str = msg_params[strings::keyboard_properties] - [strings::auto_complete_text].asCharArray(); + if (msg_params[strings::keyboard_properties].keyExists( + strings::auto_complete_text)) { + str = + msg_params[strings::keyboard_properties][strings::auto_complete_text] + .asCharArray(); if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid keyboard_properties " - "auto_complete_text syntax check failed"); + LOG4CXX_ERROR(logger_, + "Invalid keyboard_properties " + "auto_complete_text syntax check failed"); return true; } } diff --git a/src/components/application_manager/src/commands/mobile/set_global_properties_response.cc b/src/components/application_manager/src/commands/mobile/set_global_properties_response.cc index 9e4880e53d..5cfbcb2d58 100644 --- a/src/components/application_manager/src/commands/mobile/set_global_properties_response.cc +++ b/src/components/application_manager/src/commands/mobile/set_global_properties_response.cc @@ -33,19 +33,15 @@ #include "application_manager/commands/mobile/set_global_properties_response.h" - - namespace application_manager { namespace commands { SetGlobalPropertiesResponse::SetGlobalPropertiesResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} + : CommandResponseImpl(message, application_manager) {} -SetGlobalPropertiesResponse::~SetGlobalPropertiesResponse() { -} +SetGlobalPropertiesResponse::~SetGlobalPropertiesResponse() {} void SetGlobalPropertiesResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/set_icon_request.cc b/src/components/application_manager/src/commands/mobile/set_icon_request.cc index 0aa6e34488..85f34aead9 100644 --- a/src/components/application_manager/src/commands/mobile/set_icon_request.cc +++ b/src/components/application_manager/src/commands/mobile/set_icon_request.cc @@ -43,18 +43,16 @@ namespace application_manager { namespace commands { -SetIconRequest::SetIconRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager) { -} +SetIconRequest::SetIconRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : CommandRequestImpl(message, application_manager) {} -SetIconRequest::~SetIconRequest() { -} +SetIconRequest::~SetIconRequest() {} void SetIconRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); - ApplicationSharedPtr app = - application_manager_.application(connection_key()); + ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { LOG4CXX_ERROR(logger_, "Application is not registered"); @@ -77,22 +75,22 @@ void SetIconRequest::Run() { return; } - smart_objects::SmartObject msg_params = smart_objects::SmartObject( - smart_objects::SmartType_Map); + smart_objects::SmartObject msg_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); msg_params[strings::app_id] = app->app_id(); - msg_params[strings::sync_file_name] = smart_objects::SmartObject( - smart_objects::SmartType_Map); + msg_params[strings::sync_file_name] = + smart_objects::SmartObject(smart_objects::SmartType_Map); -// Panasonic requres unchanged path value without encoded special characters - const std::string full_file_path_for_hmi = file_system::ConvertPathForURL( - full_file_path); + // Panasonic requres unchanged path value without encoded special characters + const std::string full_file_path_for_hmi = + file_system::ConvertPathForURL(full_file_path); msg_params[strings::sync_file_name][strings::value] = full_file_path_for_hmi; // TODO(VS): research why is image_type hardcoded msg_params[strings::sync_file_name][strings::image_type] = - static_cast<int32_t> (SetIconRequest::ImageType::DYNAMIC); + static_cast<int32_t>(SetIconRequest::ImageType::DYNAMIC); // for further use in on_event function (*message_)[strings::msg_params][strings::sync_file_name] = @@ -117,9 +115,9 @@ void SetIconRequest::on_event(const event_engine::Event& event) { ApplicationSharedPtr app = application_manager_.application(connection_key()); - const std::string path = (*message_)[strings::msg_params] - [strings::sync_file_name] - [strings::value].asString(); + const std::string path = + (*message_)[strings::msg_params][strings::sync_file_name] + [strings::value].asString(); app->set_app_icon_path(path); LOG4CXX_INFO(logger_, diff --git a/src/components/application_manager/src/commands/mobile/set_icon_response.cc b/src/components/application_manager/src/commands/mobile/set_icon_response.cc index 92c0a666c9..c140d04f51 100644 --- a/src/components/application_manager/src/commands/mobile/set_icon_response.cc +++ b/src/components/application_manager/src/commands/mobile/set_icon_response.cc @@ -40,11 +40,9 @@ namespace commands { SetIconResponse::SetIconResponse(const MessageSharedPtr& message, ApplicationManager& app_man) - : CommandResponseImpl(message, app_man) { -} + : CommandResponseImpl(message, app_man) {} -SetIconResponse::~SetIconResponse() { -} +SetIconResponse::~SetIconResponse() {} void SetIconResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/set_media_clock_timer_request.cc b/src/components/application_manager/src/commands/mobile/set_media_clock_timer_request.cc index 444efdce86..a198ce63c3 100644 --- a/src/components/application_manager/src/commands/mobile/set_media_clock_timer_request.cc +++ b/src/components/application_manager/src/commands/mobile/set_media_clock_timer_request.cc @@ -41,18 +41,16 @@ namespace application_manager { namespace commands { -SetMediaClockRequest::SetMediaClockRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager) { -} +SetMediaClockRequest::SetMediaClockRequest( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : CommandRequestImpl(message, application_manager) {} -SetMediaClockRequest::~SetMediaClockRequest() { -} +SetMediaClockRequest::~SetMediaClockRequest() {} void SetMediaClockRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); - ApplicationSharedPtr app = - application_manager_.application(connection_key()); + ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); @@ -67,14 +65,14 @@ void SetMediaClockRequest::Run() { } if (isDataValid()) { - smart_objects::SmartObject msg_params = smart_objects::SmartObject( - smart_objects::SmartType_Map); + smart_objects::SmartObject msg_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); // copy entirely msg msg_params = (*message_)[strings::msg_params]; msg_params[strings::app_id] = app->app_id(); - SendHMIRequest(hmi_apis::FunctionID::UI_SetMediaClockTimer, - &msg_params, true); + SendHMIRequest( + hmi_apis::FunctionID::UI_SetMediaClockTimer, &msg_params, true); } else { SendResponse(false, mobile_apis::Result::INVALID_DATA); } @@ -110,7 +108,6 @@ bool SetMediaClockRequest::isDataValid() { if (update_mode == mobile_apis::UpdateMode::COUNTUP || update_mode == mobile_apis::UpdateMode::COUNTDOWN) { - if (!msg_params.keyExists(strings::start_time)) { LOG4CXX_INFO(logger_, "Invalid data"); return false; @@ -134,9 +131,9 @@ bool SetMediaClockRequest::isDataValid() { (msg_params[strings::end_time][strings::seconds].asUInt()); if (((end_time_in_seconds > start_time_in_seconds) && - (update_mode == mobile_apis::UpdateMode::COUNTDOWN)) || + (update_mode == mobile_apis::UpdateMode::COUNTDOWN)) || ((end_time_in_seconds < start_time_in_seconds) && - (update_mode == mobile_apis::UpdateMode::COUNTUP))) { + (update_mode == mobile_apis::UpdateMode::COUNTUP))) { LOG4CXX_INFO(logger_, "Invalid data"); return false; } diff --git a/src/components/application_manager/src/commands/mobile/set_media_clock_timer_response.cc b/src/components/application_manager/src/commands/mobile/set_media_clock_timer_response.cc index e1d3259a23..30e802a1db 100644 --- a/src/components/application_manager/src/commands/mobile/set_media_clock_timer_response.cc +++ b/src/components/application_manager/src/commands/mobile/set_media_clock_timer_response.cc @@ -33,18 +33,15 @@ #include "application_manager/commands/mobile/set_media_clock_timer_response.h" - namespace application_manager { namespace commands { SetMediaClockTimerResponse::SetMediaClockTimerResponse( - const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : CommandResponseImpl(message, application_manager) {} -SetMediaClockTimerResponse::~SetMediaClockTimerResponse() { -} +SetMediaClockTimerResponse::~SetMediaClockTimerResponse() {} void SetMediaClockTimerResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/show_constant_tbt_request.cc b/src/components/application_manager/src/commands/mobile/show_constant_tbt_request.cc index 6d2deddc46..2d79e13582 100644 --- a/src/components/application_manager/src/commands/mobile/show_constant_tbt_request.cc +++ b/src/components/application_manager/src/commands/mobile/show_constant_tbt_request.cc @@ -45,12 +45,11 @@ namespace application_manager { namespace commands { -ShowConstantTBTRequest::ShowConstantTBTRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager) { -} +ShowConstantTBTRequest::ShowConstantTBTRequest( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : CommandRequestImpl(message, application_manager) {} -ShowConstantTBTRequest::~ShowConstantTBTRequest() { -} +ShowConstantTBTRequest::~ShowConstantTBTRequest() {} void ShowConstantTBTRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); @@ -70,8 +69,8 @@ void ShowConstantTBTRequest::Run() { return; } - smart_objects::SmartObject msg_params = smart_objects::SmartObject( - smart_objects::SmartType_Map); + smart_objects::SmartObject msg_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); msg_params = (*message_)[strings::msg_params]; if (IsWhiteSpaceExist()) { @@ -81,12 +80,13 @@ void ShowConstantTBTRequest::Run() { return; } - //ProcessSoftButtons checks strings on the contents incorrect character + // ProcessSoftButtons checks strings on the contents incorrect character mobile_apis::Result::eType processing_result = - MessageHelper::ProcessSoftButtons( - msg_params, - app, application_manager_.GetPolicyHandler() , application_manager_); + MessageHelper::ProcessSoftButtons(msg_params, + app, + application_manager_.GetPolicyHandler(), + application_manager_); if (mobile_apis::Result::SUCCESS != processing_result) { LOG4CXX_ERROR(logger_, "INVALID_DATA!"); @@ -94,9 +94,7 @@ void ShowConstantTBTRequest::Run() { return; } - - mobile_apis::Result::eType verification_result = - mobile_apis::Result::SUCCESS; + mobile_apis::Result::eType verification_result = mobile_apis::Result::SUCCESS; if (msg_params.keyExists(strings::turn_icon)) { verification_result = MessageHelper::VerifyImage( msg_params[strings::turn_icon], app, application_manager_); @@ -119,8 +117,8 @@ void ShowConstantTBTRequest::Run() { msg_params[strings::app_id] = app->app_id(); - msg_params[hmi_request::navi_texts] = smart_objects::SmartObject( - smart_objects::SmartType_Array); + msg_params[hmi_request::navi_texts] = + smart_objects::SmartObject(smart_objects::SmartType_Array); int32_t index = 0; if (msg_params.keyExists(strings::navigation_text_1)) { @@ -160,24 +158,24 @@ void ShowConstantTBTRequest::Run() { } if (msg_params.keyExists(strings::time_to_destination)) { - // erase useless param - msg_params.erase(strings::time_to_destination); - msg_params[hmi_request::navi_texts][index][hmi_request::field_name] = - static_cast<int32_t>(hmi_apis::Common_TextFieldName::timeToDestination); - msg_params[hmi_request::navi_texts][index++][hmi_request::field_text] = - (*message_)[strings::msg_params][strings::time_to_destination]; + // erase useless param + msg_params.erase(strings::time_to_destination); + msg_params[hmi_request::navi_texts][index][hmi_request::field_name] = + static_cast<int32_t>(hmi_apis::Common_TextFieldName::timeToDestination); + msg_params[hmi_request::navi_texts][index++][hmi_request::field_text] = + (*message_)[strings::msg_params][strings::time_to_destination]; } if (msg_params.keyExists(strings::soft_buttons)) { - MessageHelper::SubscribeApplicationToSoftButton(msg_params, app, function_id()); + MessageHelper::SubscribeApplicationToSoftButton( + msg_params, app, function_id()); } app->set_tbt_show_command(msg_params); - SendHMIRequest(hmi_apis::FunctionID::Navigation_ShowConstantTBT, &msg_params, - true); + SendHMIRequest( + hmi_apis::FunctionID::Navigation_ShowConstantTBT, &msg_params, true); } - void ShowConstantTBTRequest::on_event(const event_engine::Event& event) { LOG4CXX_AUTO_TRACE(logger_); const smart_objects::SmartObject& message = event.smart_object(); @@ -191,24 +189,25 @@ void ShowConstantTBTRequest::on_event(const event_engine::Event& event) { GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asInt())); HMICapabilities& hmi_capabilities = - application_manager_.hmi_capabilities(); + application_manager_.hmi_capabilities(); bool result = false; if (mobile_apis::Result::SUCCESS == result_code) { result = true; return_info = message[strings::msg_params][hmi_response::message].asString(); } else if ((mobile_apis::Result::UNSUPPORTED_RESOURCE == result_code) && - hmi_capabilities.is_ui_cooperating()) { + hmi_capabilities.is_ui_cooperating()) { result = true; } - SendResponse(result, result_code, + SendResponse(result, + result_code, return_info.empty() ? 0 : return_info.c_str(), &(message[strings::msg_params])); break; } default: { - LOG4CXX_ERROR(logger_,"Received unknown event" << event.id()); + LOG4CXX_ERROR(logger_, "Received unknown event" << event.id()); break; } } @@ -219,8 +218,8 @@ bool ShowConstantTBTRequest::IsWhiteSpaceExist() { const char* str = NULL; if ((*message_)[strings::msg_params].keyExists(strings::turn_icon)) { - str = (*message_)[strings::msg_params] - [strings::turn_icon][strings::value].asCharArray(); + str = (*message_)[strings::msg_params][strings::turn_icon][strings::value] + .asCharArray(); if (!CheckSyntax(str)) { LOG4CXX_ERROR(logger_, "Invalid turn_icon value syntax check failed"); return true; @@ -228,8 +227,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(); + str = (*message_)[strings::msg_params][strings::next_turn_icon] + [strings::value].asCharArray(); if (!CheckSyntax(str)) { LOG4CXX_ERROR(logger_, "Invalid next_turn_icon value syntax check failed"); @@ -238,8 +237,8 @@ bool ShowConstantTBTRequest::IsWhiteSpaceExist() { } if ((*message_)[strings::msg_params].keyExists(strings::navigation_text_1)) { - str = (*message_)[strings::msg_params] - [strings::navigation_text_1].asCharArray(); + str = (*message_)[strings::msg_params][strings::navigation_text_1] + .asCharArray(); if (strlen(str) && !CheckSyntax(str)) { LOG4CXX_ERROR(logger_, "Invalid navigation_text_1 value syntax check failed"); @@ -248,8 +247,8 @@ bool ShowConstantTBTRequest::IsWhiteSpaceExist() { } if ((*message_)[strings::msg_params].keyExists(strings::navigation_text_2)) { - str = (*message_)[strings::msg_params] - [strings::navigation_text_2].asCharArray(); + str = (*message_)[strings::msg_params][strings::navigation_text_2] + .asCharArray(); if (strlen(str) && !CheckSyntax(str)) { LOG4CXX_ERROR(logger_, "Invalid navigation_text_2 value syntax check failed"); @@ -266,8 +265,8 @@ bool ShowConstantTBTRequest::IsWhiteSpaceExist() { } if ((*message_)[strings::msg_params].keyExists(strings::total_distance)) { - str = (*message_)[strings::msg_params] - [strings::total_distance].asCharArray(); + str = + (*message_)[strings::msg_params][strings::total_distance].asCharArray(); if (strlen(str) && !CheckSyntax(str)) { LOG4CXX_ERROR(logger_, "Invalid total_distance value syntax check failed"); @@ -275,9 +274,10 @@ bool ShowConstantTBTRequest::IsWhiteSpaceExist() { } } - if ((*message_)[strings::msg_params].keyExists(strings::time_to_destination)) { - str = (*message_)[strings::msg_params] - [strings::time_to_destination].asCharArray(); + if ((*message_)[strings::msg_params].keyExists( + strings::time_to_destination)) { + str = (*message_)[strings::msg_params][strings::time_to_destination] + .asCharArray(); if (strlen(str) && !CheckSyntax(str)) { LOG4CXX_ERROR(logger_, "Invalid time_to_destination value syntax check failed"); diff --git a/src/components/application_manager/src/commands/mobile/show_constant_tbt_response.cc b/src/components/application_manager/src/commands/mobile/show_constant_tbt_response.cc index 3669159fb5..80a36129cf 100644 --- a/src/components/application_manager/src/commands/mobile/show_constant_tbt_response.cc +++ b/src/components/application_manager/src/commands/mobile/show_constant_tbt_response.cc @@ -42,11 +42,9 @@ namespace commands { ShowConstantTBTResponse::ShowConstantTBTResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} + : CommandResponseImpl(message, application_manager) {} -ShowConstantTBTResponse::~ShowConstantTBTResponse() { -} +ShowConstantTBTResponse::~ShowConstantTBTResponse() {} void ShowConstantTBTResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/show_request.cc b/src/components/application_manager/src/commands/mobile/show_request.cc index 2684417a62..467d8d0236 100644 --- a/src/components/application_manager/src/commands/mobile/show_request.cc +++ b/src/components/application_manager/src/commands/mobile/show_request.cc @@ -43,26 +43,23 @@ namespace application_manager { namespace commands { -ShowRequest::ShowRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager) { -} +ShowRequest::ShowRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : CommandRequestImpl(message, application_manager) {} -ShowRequest::~ShowRequest() { -} +ShowRequest::~ShowRequest() {} void ShowRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); - ApplicationSharedPtr app = - application_manager_.application( - connection_key()); + 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; } - //SDLAQ-CRS-494, VC3.1 + // SDLAQ-CRS-494, VC3.1 if ((*message_)[strings::msg_params].empty()) { LOG4CXX_ERROR(logger_, strings::msg_params << " is empty."); SendResponse(false, mobile_apis::Result::INVALID_DATA); @@ -70,19 +67,21 @@ void ShowRequest::Run() { } if (!CheckStringsOfShowRequest()) { - LOG4CXX_ERROR(logger_, "Incorrect characters in string"); - SendResponse(false, mobile_apis::Result::INVALID_DATA); - return; - } + LOG4CXX_ERROR(logger_, "Incorrect characters in string"); + SendResponse(false, mobile_apis::Result::INVALID_DATA); + return; + } - //ProcessSoftButtons checks strings on the contents incorrect character + // ProcessSoftButtons checks strings on the contents incorrect character mobile_apis::Result::eType processing_result = mobile_apis::Result::SUCCESS; - if(((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) && + if (((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) && ((*message_)[strings::msg_params][strings::soft_buttons].length() > 0)) { processing_result = MessageHelper::ProcessSoftButtons( (*message_)[strings::msg_params], - app, application_manager_.GetPolicyHandler(),application_manager_); + app, + application_manager_.GetPolicyHandler(), + application_manager_); } if (mobile_apis::Result::SUCCESS != processing_result) { @@ -91,13 +90,14 @@ void ShowRequest::Run() { return; } - mobile_apis::Result::eType verification_result = - mobile_apis::Result::SUCCESS; + 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()) { + ((*message_)[strings::msg_params][strings::graphic][strings::value] + .asString()).length()) { verification_result = MessageHelper::VerifyImage( - (*message_)[strings::msg_params][strings::graphic], app, application_manager_); + (*message_)[strings::msg_params][strings::graphic], + app, + application_manager_); if (mobile_apis::Result::SUCCESS != verification_result) { LOG4CXX_ERROR(logger_, "Image verification failed."); SendResponse(false, verification_result); @@ -107,7 +107,9 @@ void ShowRequest::Run() { if ((*message_)[strings::msg_params].keyExists(strings::secondary_graphic)) { verification_result = MessageHelper::VerifyImage( - (*message_)[strings::msg_params][strings::secondary_graphic], app, application_manager_); + (*message_)[strings::msg_params][strings::secondary_graphic], + app, + application_manager_); if (mobile_apis::Result::SUCCESS != verification_result) { LOG4CXX_ERROR(logger_, "Image verification failed."); SendResponse(false, verification_result); @@ -115,12 +117,12 @@ void ShowRequest::Run() { } } - smart_objects::SmartObject msg_params = smart_objects::SmartObject( - smart_objects::SmartType_Map); + smart_objects::SmartObject msg_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); msg_params[strings::app_id] = app->app_id(); - msg_params[hmi_request::show_strings] = smart_objects::SmartObject( - smart_objects::SmartType_Array); + msg_params[hmi_request::show_strings] = + smart_objects::SmartObject(smart_objects::SmartType_Array); int32_t index = 0; if ((*message_)[strings::msg_params].keyExists(strings::main_field_1)) { @@ -191,7 +193,7 @@ void ShowRequest::Run() { if ((*message_)[strings::msg_params].keyExists(strings::secondary_graphic)) { msg_params[strings::secondary_graphic] = - (*message_)[strings::msg_params][strings::secondary_graphic]; + (*message_)[strings::msg_params][strings::secondary_graphic]; } if ((*message_)[strings::msg_params].keyExists(strings::soft_buttons)) { @@ -228,13 +230,12 @@ void ShowRequest::on_event(const event_engine::Event& event) { std::string response_info; mobile_apis::Result::eType result_code = static_cast<mobile_apis::Result::eType>( - message[strings::params][hmi_response::code].asInt()); + message[strings::params][hmi_response::code].asInt()); - const bool result = - Compare<mobile_api::Result::eType, EQ, ONE>( - result_code, - mobile_api::Result::SUCCESS, - mobile_api::Result::WARNINGS); + const bool result = Compare<mobile_api::Result::eType, EQ, ONE>( + result_code, + mobile_api::Result::SUCCESS, + mobile_api::Result::WARNINGS); if (mobile_apis::Result::WARNINGS == result_code && message[strings::params].keyExists(hmi_response::message)) { @@ -242,13 +243,14 @@ void ShowRequest::on_event(const event_engine::Event& event) { message[strings::params][hmi_response::message].asString(); } - SendResponse(result, result_code, + SendResponse(result, + result_code, response_info.empty() ? NULL : response_info.c_str(), &(message[strings::msg_params])); break; } default: { - LOG4CXX_ERROR(logger_,"Received unknown event " << event.id()); + LOG4CXX_ERROR(logger_, "Received unknown event " << event.id()); break; } } @@ -262,7 +264,7 @@ bool ShowRequest::CheckStringsOfShowRequest() { str = (*message_)[strings::msg_params][strings::main_field_4].asCharArray(); if (strlen(str) && !CheckSyntax(str)) { LOG4CXX_ERROR(logger_, "Invalid main_field_4 syntax check failed"); - return false; + return false; } } if ((*message_)[strings::msg_params].keyExists(strings::main_field_3)) { @@ -308,20 +310,20 @@ bool ShowRequest::CheckStringsOfShowRequest() { } } if ((*message_)[strings::msg_params].keyExists(strings::custom_presets)) { - smart_objects::SmartObject& custom_presets_array = - (*message_)[strings::msg_params][strings::custom_presets]; - for (size_t i = 0; i < custom_presets_array.length(); ++i) { - str = custom_presets_array[i].asCharArray(); - if (!CheckSyntax(str)) { - LOG4CXX_ERROR(logger_, "Invalid custom_presets syntax check failed"); - return false; - } + smart_objects::SmartObject& custom_presets_array = + (*message_)[strings::msg_params][strings::custom_presets]; + for (size_t i = 0; i < custom_presets_array.length(); ++i) { + str = custom_presets_array[i].asCharArray(); + if (!CheckSyntax(str)) { + LOG4CXX_ERROR(logger_, "Invalid custom_presets syntax check failed"); + return false; } + } } if ((*message_)[strings::msg_params].keyExists(strings::graphic)) { - str = (*message_)[strings::msg_params] - [strings::graphic][strings::value].asCharArray(); + str = (*message_)[strings::msg_params][strings::graphic][strings::value] + .asCharArray(); if (strlen(str) && !CheckSyntax(str)) { LOG4CXX_ERROR(logger_, "Invalid graphic value syntax check failed"); return false; @@ -329,11 +331,11 @@ bool ShowRequest::CheckStringsOfShowRequest() { } if ((*message_)[strings::msg_params].keyExists(strings::secondary_graphic)) { - str = (*message_)[strings::msg_params] - [strings::secondary_graphic][strings::value].asCharArray(); + str = (*message_)[strings::msg_params][strings::secondary_graphic] + [strings::value].asCharArray(); if (!CheckSyntax(str)) { LOG4CXX_ERROR(logger_, - "Invalid secondary_graphic value syntax check failed"); + "Invalid secondary_graphic value syntax check failed"); return false; } } diff --git a/src/components/application_manager/src/commands/mobile/show_response.cc b/src/components/application_manager/src/commands/mobile/show_response.cc index 764f37d42c..8027c908f1 100644 --- a/src/components/application_manager/src/commands/mobile/show_response.cc +++ b/src/components/application_manager/src/commands/mobile/show_response.cc @@ -40,12 +40,11 @@ namespace application_manager { namespace commands { -ShowResponse::ShowResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} +ShowResponse::ShowResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : CommandResponseImpl(message, application_manager) {} -ShowResponse::~ShowResponse() { -} +ShowResponse::~ShowResponse() {} void ShowResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/slider_request.cc b/src/components/application_manager/src/commands/mobile/slider_request.cc index 0c4b177d44..3920b49db3 100644 --- a/src/components/application_manager/src/commands/mobile/slider_request.cc +++ b/src/components/application_manager/src/commands/mobile/slider_request.cc @@ -42,16 +42,15 @@ namespace application_manager { namespace commands { -SliderRequest::SliderRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager) { +SliderRequest::SliderRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : CommandRequestImpl(message, application_manager) { subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout); } -SliderRequest::~SliderRequest() { -} +SliderRequest::~SliderRequest() {} bool SliderRequest::Init() { - /* Timeout in milliseconds. If omitted a standard value of 10000 milliseconds is used.*/ if ((*message_)[strings::msg_params].keyExists(strings::timeout)) { @@ -66,9 +65,8 @@ bool SliderRequest::Init() { void SliderRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); - ApplicationSharedPtr application = - application_manager_.application( - (*message_)[strings::params][strings::connection_key].asUInt()); + ApplicationSharedPtr application = application_manager_.application( + (*message_)[strings::params][strings::connection_key].asUInt()); if (!application) { LOG4CXX_ERROR(logger_, "Application is not registered"); @@ -85,9 +83,8 @@ void SliderRequest::Run() { if ((*message_)[strings::msg_params].keyExists(strings::slider_footer)) { if (1 < (*message_)[strings::msg_params][strings::slider_footer].length()) { - if ((*message_)[strings::msg_params][strings::num_ticks].asUInt() - != (*message_)[strings::msg_params] - [strings::slider_footer].length()) { + if ((*message_)[strings::msg_params][strings::num_ticks].asUInt() != + (*message_)[strings::msg_params][strings::slider_footer].length()) { LOG4CXX_ERROR(logger_, "INVALID_DATA"); SendResponse(false, mobile_apis::Result::INVALID_DATA); return; @@ -101,8 +98,8 @@ void SliderRequest::Run() { return; } - smart_objects::SmartObject msg_params = smart_objects::SmartObject( - smart_objects::SmartType_Map); + smart_objects::SmartObject msg_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); msg_params = (*message_)[strings::msg_params]; msg_params[strings::app_id] = application->app_id(); @@ -124,9 +121,8 @@ void SliderRequest::on_event(const event_engine::Event& event) { const event_engine::Event::EventID event_id = event.id(); if (event_id == FunctionID::UI_OnResetTimeout) { LOG4CXX_INFO(logger_, "Received UI_OnResetTimeout event"); - application_manager_.updateRequestTimeout(connection_key(), - correlation_id(), - default_timeout()); + application_manager_.updateRequestTimeout( + connection_key(), correlation_id(), default_timeout()); return; } @@ -142,30 +138,25 @@ void SliderRequest::on_event(const event_engine::Event& event) { SmartObject response_msg_params = message[strings::msg_params]; - const bool is_timeout_aborted = - Compare<Common_Result::eType, EQ, ONE>( - response_code, - Common_Result::TIMED_OUT, - Common_Result::ABORTED); + const bool is_timeout_aborted = Compare<Common_Result::eType, EQ, ONE>( + response_code, Common_Result::TIMED_OUT, Common_Result::ABORTED); if (is_timeout_aborted) { - if (message[strings::params][strings::data] - .keyExists(strings::slider_position)) { - //Copy slider_position info to msg_params section + if (message[strings::params][strings::data].keyExists( + strings::slider_position)) { + // Copy slider_position info to msg_params section response_msg_params[strings::slider_position] = message[strings::params][strings::data][strings::slider_position]; } else { - LOG4CXX_ERROR(logger_, strings::slider_position << " field is absent" - " in response."); + LOG4CXX_ERROR(logger_, + strings::slider_position << " field is absent" + " in response."); response_msg_params[strings::slider_position] = 0; } } - const bool is_response_success = - Compare<Common_Result::eType, EQ, ONE>( - response_code, - Common_Result::SUCCESS, - Common_Result::WARNINGS); + const bool is_response_success = Compare<Common_Result::eType, EQ, ONE>( + response_code, Common_Result::SUCCESS, Common_Result::WARNINGS); SendResponse(is_response_success, MessageHelper::HMIToMobileResult(response_code), @@ -203,4 +194,3 @@ bool SliderRequest::IsWhiteSpaceExist() { } // namespace commands } // namespace application_manager - diff --git a/src/components/application_manager/src/commands/mobile/slider_response.cc b/src/components/application_manager/src/commands/mobile/slider_response.cc index dd9837ba7f..2cfcaf48fd 100644 --- a/src/components/application_manager/src/commands/mobile/slider_response.cc +++ b/src/components/application_manager/src/commands/mobile/slider_response.cc @@ -33,17 +33,15 @@ #include "application_manager/commands/mobile/slider_response.h" - namespace application_manager { namespace commands { -SliderResponse::SliderResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} +SliderResponse::SliderResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : CommandResponseImpl(message, application_manager) {} -SliderResponse::~SliderResponse() { -} +SliderResponse::~SliderResponse() {} void SliderResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/speak_request.cc b/src/components/application_manager/src/commands/mobile/speak_request.cc index da65c8b57b..7e4731b569 100644 --- a/src/components/application_manager/src/commands/mobile/speak_request.cc +++ b/src/components/application_manager/src/commands/mobile/speak_request.cc @@ -42,20 +42,18 @@ namespace application_manager { namespace commands { -SpeakRequest::SpeakRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager) { +SpeakRequest::SpeakRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : CommandRequestImpl(message, application_manager) { subscribe_on_event(hmi_apis::FunctionID::TTS_OnResetTimeout); } -SpeakRequest::~SpeakRequest() { -} +SpeakRequest::~SpeakRequest() {} void SpeakRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); - ApplicationSharedPtr app = - application_manager_.application( - connection_key()); + ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { LOG4CXX_ERROR(logger_, "NULL pointer"); @@ -75,7 +73,8 @@ void SpeakRequest::Run() { (*message_)[strings::msg_params][hmi_request::speak_type] = hmi_apis::Common_MethodName::SPEAK; SendHMIRequest(hmi_apis::FunctionID::TTS_Speak, - &message_->getElement(strings::msg_params), true); + &message_->getElement(strings::msg_params), + true); } void SpeakRequest::on_event(const event_engine::Event& event) { @@ -102,7 +101,7 @@ void SpeakRequest::on_event(const event_engine::Event& event) { } void SpeakRequest::ProcessTTSSpeakResponse( - const smart_objects::SmartObject& message) { + const smart_objects::SmartObject& message) { LOG4CXX_AUTO_TRACE(logger_); using namespace helpers; @@ -116,36 +115,32 @@ void SpeakRequest::ProcessTTSSpeakResponse( hmi_apis::Common_Result::eType hmi_result_code = static_cast<hmi_apis::Common_Result::eType>( - message[strings::params][hmi_response::code].asInt()); + message[strings::params][hmi_response::code].asInt()); mobile_apis::Result::eType result_code = - MessageHelper::HMIToMobileResult(hmi_result_code); + MessageHelper::HMIToMobileResult(hmi_result_code); - const bool result = - Compare<mobile_api::Result::eType, EQ, ONE>( - result_code, - mobile_api::Result::SUCCESS, - mobile_api::Result::WARNINGS); + const bool result = Compare<mobile_api::Result::eType, EQ, ONE>( + result_code, mobile_api::Result::SUCCESS, mobile_api::Result::WARNINGS); (*message_)[strings::params][strings::function_id] = mobile_apis::FunctionID::SpeakID; const char* return_info = NULL; - const bool is_result_ok = - Compare<mobile_api::Result::eType, EQ, ONE>( - result_code, - mobile_api::Result::UNSUPPORTED_RESOURCE, - mobile_api::Result::WARNINGS); + const bool is_result_ok = Compare<mobile_api::Result::eType, EQ, ONE>( + result_code, + mobile_api::Result::UNSUPPORTED_RESOURCE, + mobile_api::Result::WARNINGS); if (is_result_ok) { result_code = mobile_apis::Result::WARNINGS; - return_info = std::string( - "Unsupported phoneme type sent in a prompt").c_str(); + return_info = + std::string("Unsupported phoneme type sent in a prompt").c_str(); } - SendResponse(result, result_code, return_info, - &(message[strings::msg_params])); + SendResponse( + result, result_code, return_info, &(message[strings::msg_params])); } bool SpeakRequest::IsWhiteSpaceExist() { diff --git a/src/components/application_manager/src/commands/mobile/speak_response.cc b/src/components/application_manager/src/commands/mobile/speak_response.cc index 1deae79990..612d32c913 100644 --- a/src/components/application_manager/src/commands/mobile/speak_response.cc +++ b/src/components/application_manager/src/commands/mobile/speak_response.cc @@ -40,12 +40,11 @@ namespace application_manager { namespace commands { -SpeakResponse::SpeakResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} +SpeakResponse::SpeakResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : CommandResponseImpl(message, application_manager) {} -SpeakResponse::~SpeakResponse() { -} +SpeakResponse::~SpeakResponse() {} void SpeakResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/subscribe_button_request.cc b/src/components/application_manager/src/commands/mobile/subscribe_button_request.cc index 98d66d9311..7ec4e20fbd 100644 --- a/src/components/application_manager/src/commands/mobile/subscribe_button_request.cc +++ b/src/components/application_manager/src/commands/mobile/subscribe_button_request.cc @@ -33,25 +33,22 @@ #include "application_manager/commands/mobile/subscribe_button_request.h" - namespace application_manager { namespace commands { namespace str = strings; -SubscribeButtonRequest::SubscribeButtonRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager) { -} +SubscribeButtonRequest::SubscribeButtonRequest( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : CommandRequestImpl(message, application_manager) {} -SubscribeButtonRequest::~SubscribeButtonRequest() { -} +SubscribeButtonRequest::~SubscribeButtonRequest() {} void SubscribeButtonRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); - ApplicationSharedPtr app = - application_manager_.application(connection_key()); + ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { LOG4CXX_ERROR(logger_, "APPLICATION_NOT_REGISTERED"); @@ -64,15 +61,16 @@ void SubscribeButtonRequest::Run() { (*message_)[str::msg_params][str::button_name].asUInt()); if (!IsSubscriptionAllowed(app, btn_id)) { - LOG4CXX_ERROR(logger_, "Subscribe on button " << btn_id - << " isn't allowed"); + LOG4CXX_ERROR(logger_, + "Subscribe on button " << btn_id << " isn't allowed"); SendResponse(false, mobile_apis::Result::REJECTED); return; } if (!CheckHMICapabilities(btn_id)) { - LOG4CXX_ERROR(logger_, "Subscribe on button " << btn_id - << " isn't allowed by HMI capabilities"); + LOG4CXX_ERROR(logger_, + "Subscribe on button " + << btn_id << " isn't allowed by HMI capabilities"); SendResponse(false, mobile_apis::Result::UNSUPPORTED_RESOURCE); return; } @@ -96,11 +94,10 @@ void SubscribeButtonRequest::Run() { bool SubscribeButtonRequest::IsSubscriptionAllowed( ApplicationSharedPtr app, mobile_apis::ButtonName::eType btn_id) { - if (!app->is_media_application() && ((mobile_apis::ButtonName::SEEKLEFT == btn_id) || - (mobile_apis::ButtonName::SEEKRIGHT == btn_id)|| - (mobile_apis::ButtonName::TUNEUP == btn_id) || + (mobile_apis::ButtonName::SEEKRIGHT == btn_id) || + (mobile_apis::ButtonName::TUNEUP == btn_id) || (mobile_apis::ButtonName::TUNEDOWN == btn_id))) { return false; } @@ -126,8 +123,8 @@ bool SubscribeButtonRequest::CheckHMICapabilities( const size_t length = button_caps.length(); for (size_t i = 0; i < length; ++i) { const SmartObject& caps = button_caps[i]; - const ButtonName::eType name = - static_cast<ButtonName::eType>(caps.getElement(hmi_response::button_name).asInt()); + const ButtonName::eType name = static_cast<ButtonName::eType>( + caps.getElement(hmi_response::button_name).asInt()); if (name == button) { return true; } diff --git a/src/components/application_manager/src/commands/mobile/subscribe_button_response.cc b/src/components/application_manager/src/commands/mobile/subscribe_button_response.cc index 390a6811a4..a92e58b19a 100644 --- a/src/components/application_manager/src/commands/mobile/subscribe_button_response.cc +++ b/src/components/application_manager/src/commands/mobile/subscribe_button_response.cc @@ -39,11 +39,9 @@ namespace commands { SubscribeButtonResponse::SubscribeButtonResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} + : CommandResponseImpl(message, application_manager) {} -SubscribeButtonResponse::~SubscribeButtonResponse() { -} +SubscribeButtonResponse::~SubscribeButtonResponse() {} void SubscribeButtonResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc b/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc index eab1ccbf26..485c5d0009 100644 --- a/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc +++ b/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_request.cc @@ -42,53 +42,67 @@ namespace commands { SubscribeVehicleDataRequest::SubscribeVehicleDataRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager) { -} + : CommandRequestImpl(message, application_manager) {} -SubscribeVehicleDataRequest::~SubscribeVehicleDataRequest() { -} +SubscribeVehicleDataRequest::~SubscribeVehicleDataRequest() {} #ifdef HMI_DBUS_API namespace { - struct Subrequest { - hmi_apis::FunctionID::eType func_id; - const char* str; - }; - Subrequest subrequests[] = { - { hmi_apis::FunctionID::VehicleInfo_SubscribeGps, strings::gps}, - { hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed, strings::speed}, - { hmi_apis::FunctionID::VehicleInfo_SubscribeRpm, strings::rpm}, - { hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel, strings::fuel_level}, - { hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State, strings::fuel_level_state}, - { hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption, strings::instant_fuel_consumption}, - { hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature, strings::external_temp}, - { hmi_apis::FunctionID::VehicleInfo_SubscribeVin, strings::vin}, - { hmi_apis::FunctionID::VehicleInfo_SubscribePrndl, strings::prndl}, - { hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure, strings::tire_pressure}, - { hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer, strings::odometer}, - { hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus, strings::belt_status}, - { hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation, strings::body_information}, - { hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus, strings::device_status}, - { hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking, strings::driver_braking}, - { hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus, strings::wiper_status}, - { hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus, strings::head_lamp_status}, - { hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque, strings::engine_torque}, - { hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition, strings::acc_pedal_pos}, - { hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle, strings::steering_wheel_angle}, - { hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo, strings::e_call_info}, - { hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus, strings::airbag_status}, - { hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent, strings::emergency_event}, - { hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus, strings::cluster_mode_status}, - { hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey, strings::my_key}, - }; +struct Subrequest { + hmi_apis::FunctionID::eType func_id; + const char* str; +}; +Subrequest subrequests[] = { + {hmi_apis::FunctionID::VehicleInfo_SubscribeGps, strings::gps}, + {hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed, strings::speed}, + {hmi_apis::FunctionID::VehicleInfo_SubscribeRpm, strings::rpm}, + {hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel, strings::fuel_level}, + {hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State, + strings::fuel_level_state}, + {hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption, + strings::instant_fuel_consumption}, + {hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature, + strings::external_temp}, + {hmi_apis::FunctionID::VehicleInfo_SubscribeVin, strings::vin}, + {hmi_apis::FunctionID::VehicleInfo_SubscribePrndl, strings::prndl}, + {hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure, + strings::tire_pressure}, + {hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer, strings::odometer}, + {hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus, + strings::belt_status}, + {hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation, + strings::body_information}, + {hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus, + strings::device_status}, + {hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking, + strings::driver_braking}, + {hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus, + strings::wiper_status}, + {hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus, + strings::head_lamp_status}, + {hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque, + strings::engine_torque}, + {hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition, + strings::acc_pedal_pos}, + {hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle, + strings::steering_wheel_angle}, + {hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo, + strings::e_call_info}, + {hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus, + strings::airbag_status}, + {hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent, + strings::emergency_event}, + {hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus, + strings::cluster_mode_status}, + {hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey, strings::my_key}, +}; } -#endif // #ifdef HMI_DBUS_API +#endif // #ifdef HMI_DBUS_API void SubscribeVehicleDataRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); - ApplicationSharedPtr app = application_manager_.application( - connection_key()); + ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { LOG4CXX_ERROR(logger_, "NULL pointer"); @@ -104,11 +118,11 @@ void SubscribeVehicleDataRequest::Run() { const VehicleData& vehicle_data = MessageHelper::vehicle_data(); VehicleData::const_iterator it = vehicle_data.begin(); - smart_objects::SmartObject msg_params = smart_objects::SmartObject( - smart_objects::SmartType_Map); + smart_objects::SmartObject msg_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); - smart_objects::SmartObject response_params = smart_objects::SmartObject( - smart_objects::SmartType_Map); + smart_objects::SmartObject response_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); for (; vehicle_data.end() != it; ++it) { const std::string& key_name = it->first; @@ -119,9 +133,11 @@ void SubscribeVehicleDataRequest::Run() { VehicleDataType key_type = it->second; if (app->IsSubscribedToIVI(key_type)) { - LOG4CXX_DEBUG(logger_, "App with connection key " << connection_key() - << " is subscribed already for VehicleDataType: " - << key_type); + LOG4CXX_DEBUG(logger_, + "App with connection key " + << connection_key() + << " is subscribed already for VehicleDataType: " + << key_type); ++subscribed_items; vi_already_subscribed_by_this_app_.insert(key_type); response_params[key_name][strings::data_type] = key_type; @@ -131,16 +147,21 @@ void SubscribeVehicleDataRequest::Run() { } if (IsSomeoneSubscribedFor(key_type)) { - LOG4CXX_DEBUG(logger_, "There are apps subscribed already for " - "VehicleDataType: " << key_type); + LOG4CXX_DEBUG(logger_, + "There are apps subscribed already for " + "VehicleDataType: " + << key_type); if (!app->SubscribeToIVI(static_cast<uint32_t>(key_type))) { - LOG4CXX_ERROR(logger_, "Unable to subscribe for VehicleDataType: " - << key_type); + LOG4CXX_ERROR( + logger_, + "Unable to subscribe for VehicleDataType: " << key_type); continue; } - LOG4CXX_DEBUG(logger_, "App with connection key " << connection_key() - << " have been subscribed for VehicleDataType: " - << key_type); + LOG4CXX_DEBUG( + logger_, + "App with connection key " + << connection_key() + << " have been subscribed for VehicleDataType: " << key_type); ++subscribed_items; vi_already_subscribed_by_another_apps_.insert(key_type); response_params[key_name][strings::data_type] = key_type; @@ -152,9 +173,11 @@ void SubscribeVehicleDataRequest::Run() { msg_params[key_name] = is_key_enabled; if (app->SubscribeToIVI(static_cast<uint32_t>(key_type))) { - LOG4CXX_DEBUG(logger_, "App with connection key " << connection_key() - << " have been subscribed for VehicleDataType: " - << key_type); + LOG4CXX_DEBUG( + logger_, + "App with connection key " + << connection_key() + << " have been subscribed for VehicleDataType: " << key_type); ++subscribed_items; } } @@ -164,14 +187,14 @@ void SubscribeVehicleDataRequest::Run() { bool is_everything_already_subscribed = static_cast<uint32_t>(items_to_subscribe) == vi_already_subscribed_by_another_apps_.size() + - vi_already_subscribed_by_this_app_.size(); + vi_already_subscribed_by_this_app_.size(); if (0 == items_to_subscribe) { if (HasDisallowedParams()) { SendResponse(false, mobile_apis::Result::DISALLOWED); } else { - SendResponse(false, mobile_apis::Result::INVALID_DATA, - "No data in the request"); + SendResponse( + false, mobile_apis::Result::INVALID_DATA, "No data in the request"); } return; } @@ -187,27 +210,23 @@ void SubscribeVehicleDataRequest::Run() { if (is_everything_already_subscribed) { mobile_apis::Result::eType result_code = vi_already_subscribed_by_this_app_.size() - ? mobile_apis::Result::IGNORED - : mobile_apis::Result::SUCCESS; + ? mobile_apis::Result::IGNORED + : mobile_apis::Result::SUCCESS; - const char* info = - vi_already_subscribed_by_this_app_.size() - ? "Already subscribed on some provided VehicleData." - : NULL; + const char* info = vi_already_subscribed_by_this_app_.size() + ? "Already subscribed on some provided VehicleData." + : NULL; - SendResponse(true, - result_code, - info, - &response_params); + SendResponse(true, result_code, info, &response_params); return; } #ifdef HMI_DBUS_API - //Generate list of subrequests + // Generate list of subrequests for (size_t i = 0; i < sizeof(subrequests) / sizeof(subrequests[0]); ++i) { const Subrequest& sr = subrequests[i]; - if (true == (*message_)[strings::msg_params].keyExists(sr.str) - && true == (*message_)[strings::msg_params][sr.str].asBool()) { + if (true == (*message_)[strings::msg_params].keyExists(sr.str) && + true == (*message_)[strings::msg_params][sr.str].asBool()) { HmiRequest hmi_request; hmi_request.str = sr.str; hmi_request.func_id = sr.func_id; @@ -215,17 +234,19 @@ void SubscribeVehicleDataRequest::Run() { hmi_requests_.push_back(hmi_request); } } - LOG4CXX_DEBUG(logger_, hmi_requests_.size() << - " requests are going to be sent to HMI"); + LOG4CXX_DEBUG( + logger_, hmi_requests_.size() << " requests are going to be sent to HMI"); - //Send subrequests + // Send subrequests for (HmiRequests::const_iterator it = hmi_requests_.begin(); - it != hmi_requests_.end(); ++it) + it != hmi_requests_.end(); + ++it) SendHMIRequest(it->func_id, &msg_params, true); #else SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData, - &msg_params, true); -#endif // #ifdef HMI_DBUS_API + &msg_params, + true); +#endif // #ifdef HMI_DBUS_API } void SubscribeVehicleDataRequest::on_event(const event_engine::Event& event) { @@ -239,8 +260,8 @@ void SubscribeVehicleDataRequest::on_event(const event_engine::Event& event) { return; } - ApplicationSharedPtr app = application_manager_.application( - CommandRequestImpl::connection_key()); + ApplicationSharedPtr app = + application_manager_.application(CommandRequestImpl::connection_key()); if (!app) { LOG4CXX_ERROR(logger_, "NULL pointer."); @@ -249,23 +270,24 @@ void SubscribeVehicleDataRequest::on_event(const event_engine::Event& event) { #ifdef HMI_DBUS_API for (HmiRequests::iterator it = hmi_requests_.begin(); - it != hmi_requests_.end(); ++it) { - HmiRequest & hmi_request = *it; + it != hmi_requests_.end(); + ++it) { + HmiRequest& hmi_request = *it; if (hmi_request.func_id == event.id()) { - hmi_request.status = - static_cast<hmi_apis::Common_Result::eType>( - message[strings::params][hmi_response::code].asInt()); + hmi_request.status = static_cast<hmi_apis::Common_Result::eType>( + message[strings::params][hmi_response::code].asInt()); if (hmi_apis::Common_Result::SUCCESS == hmi_request.status) hmi_request.value = message[strings::msg_params][hmi_request.str]; hmi_request.complete = true; break; } } - bool all_complete = true; + bool all_complete = true; bool any_arg_success = false; mobile_api::Result::eType status = mobile_api::Result::eType::SUCCESS; for (HmiRequests::const_iterator it = hmi_requests_.begin(); - it != hmi_requests_.end(); ++it) { + it != hmi_requests_.end(); + ++it) { if (!it->complete) { all_complete = false; break; @@ -273,12 +295,14 @@ void SubscribeVehicleDataRequest::on_event(const event_engine::Event& event) { if (hmi_apis::Common_Result::SUCCESS != it->status) { if (mobile_api::Result::SUCCESS == status) { status = static_cast<mobile_apis::Result::eType>(it->status); - } else if (status - != static_cast<mobile_apis::Result::eType>(it->status)) { + } else if (status != + static_cast<mobile_apis::Result::eType>(it->status)) { status = mobile_api::Result::eType::GENERIC_ERROR; } - LOG4CXX_TRACE(logger_, "Status from HMI: " << it->status << - ", so response status become " << status); + LOG4CXX_TRACE(logger_, + "Status from HMI: " << it->status + << ", so response status become " + << status); } else { any_arg_success = true; } @@ -288,7 +312,8 @@ void SubscribeVehicleDataRequest::on_event(const event_engine::Event& event) { smart_objects::SmartObject response_params(smart_objects::SmartType_Map); if (any_arg_success) { for (HmiRequests::const_iterator it = hmi_requests_.begin(); - it != hmi_requests_.end(); ++it) { + it != hmi_requests_.end(); + ++it) { response_params[it->str] = it->value; } } @@ -306,12 +331,12 @@ void SubscribeVehicleDataRequest::on_event(const event_engine::Event& event) { const bool is_result_no_error = Compare<hmi_apis::Common_Result::eType, EQ, ONE>( - hmi_result, - hmi_apis::Common_Result::SUCCESS, - hmi_apis::Common_Result::WARNINGS); + hmi_result, + hmi_apis::Common_Result::SUCCESS, + hmi_apis::Common_Result::WARNINGS); - bool is_succeeded = is_result_no_error || - !vi_already_subscribed_by_another_apps_.empty(); + bool is_succeeded = + is_result_no_error || !vi_already_subscribed_by_another_apps_.empty(); mobile_apis::Result::eType result_code = MessageHelper::HMIToMobileResult(hmi_result); @@ -328,19 +353,17 @@ void SubscribeVehicleDataRequest::on_event(const event_engine::Event& event) { if (!vi_already_subscribed_by_another_apps_.empty() || !vi_already_subscribed_by_this_app_.empty()) { - AddAlreadySubscribedVI(const_cast<smart_objects::SmartObject&>( - message[strings::msg_params])); + AddAlreadySubscribedVI( + const_cast<smart_objects::SmartObject&>(message[strings::msg_params])); } - SendResponse(is_succeeded, - result_code, - return_info, - &(message[strings::msg_params])); + SendResponse( + is_succeeded, result_code, return_info, &(message[strings::msg_params])); if (is_succeeded) { app->UpdateHash(); } -#endif // #ifdef HMI_DBUS_API +#endif // #ifdef HMI_DBUS_API } void SubscribeVehicleDataRequest::AddAlreadySubscribedVI( @@ -349,7 +372,7 @@ void SubscribeVehicleDataRequest::AddAlreadySubscribedVI( using namespace mobile_apis; VehicleInfoSubscriptions::const_iterator it_same_app = vi_already_subscribed_by_this_app_.begin(); - for (;vi_already_subscribed_by_this_app_.end() != it_same_app; + for (; vi_already_subscribed_by_this_app_.end() != it_same_app; ++it_same_app) { msg_params[*it_same_app][strings::result_code] = VehicleDataResultCode::VDRC_DATA_ALREADY_SUBSCRIBED; @@ -357,7 +380,7 @@ void SubscribeVehicleDataRequest::AddAlreadySubscribedVI( VehicleInfoSubscriptions::const_iterator it_another_app = vi_already_subscribed_by_another_apps_.begin(); - for (;vi_already_subscribed_by_another_apps_.end() != it_another_app; + for (; vi_already_subscribed_by_another_apps_.end() != it_another_app; ++it_another_app) { msg_params[*it_another_app][strings::result_code] = VehicleDataResultCode::VDRC_SUCCESS; @@ -374,13 +397,13 @@ void SubscribeVehicleDataRequest::UnsubscribeFailedSubscriptions( for (; vehicle_data.end() != it; ++it) { if (msg_params.keyExists(it->first)) { if (msg_params[it->first][strings::result_code].asInt() != - hmi_apis::Common_VehicleDataResultCode::VDRC_SUCCESS) { - LOG4CXX_DEBUG(logger_, "Subscription for VehicleDataType " - << it->first - << " is unsuccessfull. " - "Unsubscribing app with connection key " - << connection_key() - << " from it."); + hmi_apis::Common_VehicleDataResultCode::VDRC_SUCCESS) { + LOG4CXX_DEBUG(logger_, + "Subscription for VehicleDataType " + << it->first + << " is unsuccessfull. " + "Unsubscribing app with connection key " + << connection_key() << " from it."); app->UnsubscribeFromIVI(it->second); } } diff --git a/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_response.cc b/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_response.cc index 454c7ad9f6..7ed16407a5 100644 --- a/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_response.cc +++ b/src/components/application_manager/src/commands/mobile/subscribe_vehicle_data_response.cc @@ -41,11 +41,9 @@ namespace commands { SubscribeVehicleDataResponse::SubscribeVehicleDataResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} + : CommandResponseImpl(message, application_manager) {} -SubscribeVehicleDataResponse::~SubscribeVehicleDataResponse() { -} +SubscribeVehicleDataResponse::~SubscribeVehicleDataResponse() {} void SubscribeVehicleDataResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/subscribe_way_points_request.cc b/src/components/application_manager/src/commands/mobile/subscribe_way_points_request.cc index 9b71b71aaa..e749d4f3db 100644 --- a/src/components/application_manager/src/commands/mobile/subscribe_way_points_request.cc +++ b/src/components/application_manager/src/commands/mobile/subscribe_way_points_request.cc @@ -6,7 +6,7 @@ namespace application_manager { namespace commands { SubscribeWayPointsRequest::SubscribeWayPointsRequest( - const MessageSharedPtr &message, ApplicationManager& application_manager) + const MessageSharedPtr& message, ApplicationManager& application_manager) : CommandRequestImpl(message, application_manager) {} SubscribeWayPointsRequest::~SubscribeWayPointsRequest() {} @@ -14,13 +14,12 @@ SubscribeWayPointsRequest::~SubscribeWayPointsRequest() {} void SubscribeWayPointsRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); - ApplicationSharedPtr app = - application_manager_.application( - connection_key()); + ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { - LOG4CXX_ERROR(logger_, "An application with connection key " - << connection_key() << " is not registered."); + LOG4CXX_ERROR(logger_, + "An application with connection key " + << connection_key() << " is not registered."); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } @@ -36,16 +35,14 @@ void SubscribeWayPointsRequest::Run() { return; } - SendHMIRequest(hmi_apis::FunctionID::Navigation_SubscribeWayPoints, NULL, - true); + SendHMIRequest( + hmi_apis::FunctionID::Navigation_SubscribeWayPoints, NULL, true); } -void SubscribeWayPointsRequest::on_event(const event_engine::Event &event) { +void SubscribeWayPointsRequest::on_event(const event_engine::Event& event) { LOG4CXX_AUTO_TRACE(logger_); - ApplicationSharedPtr app = - application_manager_.application( - connection_key()); - const smart_objects::SmartObject &message = event.smart_object(); + ApplicationSharedPtr app = application_manager_.application(connection_key()); + const smart_objects::SmartObject& message = event.smart_object(); switch (event.id()) { case hmi_apis::FunctionID::Navigation_SubscribeWayPoints: { LOG4CXX_INFO(logger_, "Received Navigation_SubscribeWayPoints event"); diff --git a/src/components/application_manager/src/commands/mobile/subscribe_way_points_response.cc b/src/components/application_manager/src/commands/mobile/subscribe_way_points_response.cc index 51b213444d..c2e642619a 100644 --- a/src/components/application_manager/src/commands/mobile/subscribe_way_points_response.cc +++ b/src/components/application_manager/src/commands/mobile/subscribe_way_points_response.cc @@ -6,12 +6,10 @@ namespace application_manager { namespace commands { SubscribeWayPointsResponse::SubscribeWayPointsResponse( - const MessageSharedPtr &message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} + const MessageSharedPtr& message, ApplicationManager& application_manager) + : CommandResponseImpl(message, application_manager) {} -SubscribeWayPointsResponse::~SubscribeWayPointsResponse() { -} +SubscribeWayPointsResponse::~SubscribeWayPointsResponse() {} void SubscribeWayPointsResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/system_request.cc b/src/components/application_manager/src/commands/mobile/system_request.cc index 5c1231684e..93eab1ee1e 100644 --- a/src/components/application_manager/src/commands/mobile/system_request.cc +++ b/src/components/application_manager/src/commands/mobile/system_request.cc @@ -418,9 +418,9 @@ uint32_t SystemRequest::index = 0; const std::string kSYNC = "SYNC"; const std::string kIVSU = "IVSU"; -SystemRequest::SystemRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager) { -} +SystemRequest::SystemRequest(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : CommandRequestImpl(message, application_manager) {} SystemRequest::~SystemRequest() {} @@ -442,8 +442,8 @@ void SystemRequest::Run() { const policy::PolicyHandlerInterface& policy_handler = application_manager_.GetPolicyHandler(); - if (!policy_handler.IsRequestTypeAllowed( - application->policy_app_id(), request_type)) { + if (!policy_handler.IsRequestTypeAllowed(application->policy_app_id(), + request_type)) { SendResponse(false, mobile_apis::Result::DISALLOWED); return; } @@ -470,15 +470,18 @@ 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(); + binary_data_folder = + application_manager_.get_settings().system_files_path(); } else { - binary_data_folder = application_manager_.get_settings().app_storage_folder(); + binary_data_folder = + application_manager_.get_settings().app_storage_folder(); binary_data_folder += "/"; binary_data_folder += application->folder_name(); binary_data_folder += "/"; } - std::string file_dst_path = application_manager_.get_settings().system_files_path(); + std::string file_dst_path = + application_manager_.get_settings().system_files_path(); file_dst_path += "/"; file_dst_path += file_name; @@ -499,8 +502,7 @@ void SystemRequest::Run() { LOG4CXX_DEBUG(logger_, "Binary data is not present. Trying to find file " - << file_name - << " within previously saved app file in " + << file_name << " within previously saved app file in " << binary_data_folder); const AppFile* file = application->GetFile(app_full_file_path); @@ -579,14 +581,13 @@ void SystemRequest::on_event(const event_engine::Event& event) { GetMobileResultCode(static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asUInt())); - const bool result = - Compare<mobile_api::Result::eType, EQ, ONE>( - result_code, - mobile_api::Result::SUCCESS, - mobile_api::Result::WARNINGS); + const bool result = Compare<mobile_api::Result::eType, EQ, ONE>( + result_code, + mobile_api::Result::SUCCESS, + mobile_api::Result::WARNINGS); ApplicationSharedPtr application = - application_manager_.application(connection_key()); + application_manager_.application(connection_key()); if (!(application.valid())) { LOG4CXX_ERROR(logger_, "NULL pointer"); diff --git a/src/components/application_manager/src/commands/mobile/system_response.cc b/src/components/application_manager/src/commands/mobile/system_response.cc index 35b4d72ee2..f5bc03f4a5 100644 --- a/src/components/application_manager/src/commands/mobile/system_response.cc +++ b/src/components/application_manager/src/commands/mobile/system_response.cc @@ -33,17 +33,15 @@ #include "application_manager/commands/mobile/system_response.h" - namespace application_manager { namespace commands { -SystemResponse::SystemResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} +SystemResponse::SystemResponse(const MessageSharedPtr& message, + ApplicationManager& application_manager) + : CommandResponseImpl(message, application_manager) {} -SystemResponse::~SystemResponse() { -} +SystemResponse::~SystemResponse() {} void SystemResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/unregister_app_interface_request.cc b/src/components/application_manager/src/commands/mobile/unregister_app_interface_request.cc index 3363eb854b..d7056a624e 100644 --- a/src/components/application_manager/src/commands/mobile/unregister_app_interface_request.cc +++ b/src/components/application_manager/src/commands/mobile/unregister_app_interface_request.cc @@ -48,11 +48,13 @@ void UnregisterAppInterfaceRequest::Run() { return; } - application_manager_.ManageMobileCommand(MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( - connection_key(), - mobile_api::AppInterfaceUnregisteredReason::INVALID_ENUM), commands::Command::ORIGIN_SDL); + application_manager_.ManageMobileCommand( + MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( + connection_key(), + mobile_api::AppInterfaceUnregisteredReason::INVALID_ENUM), + commands::Command::ORIGIN_SDL); application_manager_.UnregisterApplication(connection_key(), - mobile_apis::Result::SUCCESS); + mobile_apis::Result::SUCCESS); SendResponse(true, mobile_apis::Result::SUCCESS); } diff --git a/src/components/application_manager/src/commands/mobile/unsubscribe_button_request.cc b/src/components/application_manager/src/commands/mobile/unsubscribe_button_request.cc index 478cc7881f..86df8fabb1 100644 --- a/src/components/application_manager/src/commands/mobile/unsubscribe_button_request.cc +++ b/src/components/application_manager/src/commands/mobile/unsubscribe_button_request.cc @@ -43,17 +43,14 @@ namespace str = strings; UnsubscribeButtonRequest::UnsubscribeButtonRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager) { -} + : CommandRequestImpl(message, application_manager) {} -UnsubscribeButtonRequest::~UnsubscribeButtonRequest() { -} +UnsubscribeButtonRequest::~UnsubscribeButtonRequest() {} void UnsubscribeButtonRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); - ApplicationSharedPtr app = - application_manager_.application(connection_key()); + ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { LOG4CXX_ERROR(logger_, "APPLICATION_NOT_REGISTERED"); @@ -64,13 +61,15 @@ void UnsubscribeButtonRequest::Run() { const uint32_t btn_id = (*message_)[str::msg_params][str::button_name].asUInt(); - if (!app->IsSubscribedToButton(static_cast<mobile_apis::ButtonName::eType>(btn_id))) { + if (!app->IsSubscribedToButton( + static_cast<mobile_apis::ButtonName::eType>(btn_id))) { LOG4CXX_ERROR(logger_, "App doesn't subscibe to button " << btn_id); SendResponse(false, mobile_apis::Result::IGNORED); return; } - app->UnsubscribeFromButton(static_cast<mobile_apis::ButtonName::eType>(btn_id)); + app->UnsubscribeFromButton( + static_cast<mobile_apis::ButtonName::eType>(btn_id)); SendUnsubscribeButtonNotification(); const bool is_succedeed = true; diff --git a/src/components/application_manager/src/commands/mobile/unsubscribe_button_response.cc b/src/components/application_manager/src/commands/mobile/unsubscribe_button_response.cc index f7999181a1..409579b294 100644 --- a/src/components/application_manager/src/commands/mobile/unsubscribe_button_response.cc +++ b/src/components/application_manager/src/commands/mobile/unsubscribe_button_response.cc @@ -33,18 +33,15 @@ #include "application_manager/commands/mobile/unsubscribe_button_response.h" - namespace application_manager { namespace commands { UnsubscribeButtonResponse::UnsubscribeButtonResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} + : CommandResponseImpl(message, application_manager) {} -UnsubscribeButtonResponse::~UnsubscribeButtonResponse() { -} +UnsubscribeButtonResponse::~UnsubscribeButtonResponse() {} void UnsubscribeButtonResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc b/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc index 5e33edc226..4fcc04c7be 100644 --- a/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc +++ b/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_request.cc @@ -46,53 +46,68 @@ namespace commands { UnsubscribeVehicleDataRequest::UnsubscribeVehicleDataRequest( const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager) { -} + : CommandRequestImpl(message, application_manager) {} -UnsubscribeVehicleDataRequest::~UnsubscribeVehicleDataRequest() { -} +UnsubscribeVehicleDataRequest::~UnsubscribeVehicleDataRequest() {} #ifdef HMI_DBUS_API namespace { - struct Subrequest { - hmi_apis::FunctionID::eType func_id; - const char* str; - }; - Subrequest subrequests[] = { - { hmi_apis::FunctionID::VehicleInfo_UnsubscribeGps, strings::gps}, - { hmi_apis::FunctionID::VehicleInfo_UnsubscribeSpeed, strings::speed}, - { hmi_apis::FunctionID::VehicleInfo_UnsubscribeRpm, strings::rpm}, - { hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel, strings::fuel_level}, - { hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel_State, strings::fuel_level_state}, - { hmi_apis::FunctionID::VehicleInfo_UnsubscribeInstantFuelConsumption, strings::instant_fuel_consumption}, - { hmi_apis::FunctionID::VehicleInfo_UnsubscribeExternalTemperature, strings::external_temp}, - { hmi_apis::FunctionID::VehicleInfo_UnsubscribeVin, strings::vin}, - { hmi_apis::FunctionID::VehicleInfo_UnsubscribePrndl, strings::prndl}, - { hmi_apis::FunctionID::VehicleInfo_UnsubscribeTirePressure, strings::tire_pressure}, - { hmi_apis::FunctionID::VehicleInfo_UnsubscribeOdometer, strings::odometer}, - { hmi_apis::FunctionID::VehicleInfo_UnsubscribeBeltStatus, strings::belt_status}, - { hmi_apis::FunctionID::VehicleInfo_UnsubscribeBodyInformation, strings::body_information}, - { hmi_apis::FunctionID::VehicleInfo_UnsubscribeDeviceStatus, strings::device_status}, - { hmi_apis::FunctionID::VehicleInfo_UnsubscribeDriverBraking, strings::driver_braking}, - { hmi_apis::FunctionID::VehicleInfo_UnsubscribeWiperStatus, strings::wiper_status}, - { hmi_apis::FunctionID::VehicleInfo_UnsubscribeHeadLampStatus, strings::head_lamp_status}, - { hmi_apis::FunctionID::VehicleInfo_UnsubscribeEngineTorque, strings::engine_torque}, - { hmi_apis::FunctionID::VehicleInfo_UnsubscribeAccPedalPosition, strings::acc_pedal_pos}, - { hmi_apis::FunctionID::VehicleInfo_UnsubscribeSteeringWheelAngle, strings::steering_wheel_angle}, - { hmi_apis::FunctionID::VehicleInfo_UnsubscribeECallInfo, strings::e_call_info}, - { hmi_apis::FunctionID::VehicleInfo_UnsubscribeAirbagStatus, strings::airbag_status}, - { hmi_apis::FunctionID::VehicleInfo_UnsubscribeEmergencyEvent, strings::emergency_event}, - { hmi_apis::FunctionID::VehicleInfo_UnsubscribeClusterModeStatus, strings::cluster_mode_status}, - { hmi_apis::FunctionID::VehicleInfo_UnsubscribeMyKey, strings::my_key}, - }; +struct Subrequest { + hmi_apis::FunctionID::eType func_id; + const char* str; +}; +Subrequest subrequests[] = { + {hmi_apis::FunctionID::VehicleInfo_UnsubscribeGps, strings::gps}, + {hmi_apis::FunctionID::VehicleInfo_UnsubscribeSpeed, strings::speed}, + {hmi_apis::FunctionID::VehicleInfo_UnsubscribeRpm, strings::rpm}, + {hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel, + strings::fuel_level}, + {hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel_State, + strings::fuel_level_state}, + {hmi_apis::FunctionID::VehicleInfo_UnsubscribeInstantFuelConsumption, + strings::instant_fuel_consumption}, + {hmi_apis::FunctionID::VehicleInfo_UnsubscribeExternalTemperature, + strings::external_temp}, + {hmi_apis::FunctionID::VehicleInfo_UnsubscribeVin, strings::vin}, + {hmi_apis::FunctionID::VehicleInfo_UnsubscribePrndl, strings::prndl}, + {hmi_apis::FunctionID::VehicleInfo_UnsubscribeTirePressure, + strings::tire_pressure}, + {hmi_apis::FunctionID::VehicleInfo_UnsubscribeOdometer, strings::odometer}, + {hmi_apis::FunctionID::VehicleInfo_UnsubscribeBeltStatus, + strings::belt_status}, + {hmi_apis::FunctionID::VehicleInfo_UnsubscribeBodyInformation, + strings::body_information}, + {hmi_apis::FunctionID::VehicleInfo_UnsubscribeDeviceStatus, + strings::device_status}, + {hmi_apis::FunctionID::VehicleInfo_UnsubscribeDriverBraking, + strings::driver_braking}, + {hmi_apis::FunctionID::VehicleInfo_UnsubscribeWiperStatus, + strings::wiper_status}, + {hmi_apis::FunctionID::VehicleInfo_UnsubscribeHeadLampStatus, + strings::head_lamp_status}, + {hmi_apis::FunctionID::VehicleInfo_UnsubscribeEngineTorque, + strings::engine_torque}, + {hmi_apis::FunctionID::VehicleInfo_UnsubscribeAccPedalPosition, + strings::acc_pedal_pos}, + {hmi_apis::FunctionID::VehicleInfo_UnsubscribeSteeringWheelAngle, + strings::steering_wheel_angle}, + {hmi_apis::FunctionID::VehicleInfo_UnsubscribeECallInfo, + strings::e_call_info}, + {hmi_apis::FunctionID::VehicleInfo_UnsubscribeAirbagStatus, + strings::airbag_status}, + {hmi_apis::FunctionID::VehicleInfo_UnsubscribeEmergencyEvent, + strings::emergency_event}, + {hmi_apis::FunctionID::VehicleInfo_UnsubscribeClusterModeStatus, + strings::cluster_mode_status}, + {hmi_apis::FunctionID::VehicleInfo_UnsubscribeMyKey, strings::my_key}, +}; } -#endif // #ifdef HMI_DBUS_API +#endif // #ifdef HMI_DBUS_API void UnsubscribeVehicleDataRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); - ApplicationSharedPtr app = application_manager_.application( - connection_key()); + ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { LOG4CXX_ERROR(logger_, "NULL pointer"); @@ -106,11 +121,11 @@ void UnsubscribeVehicleDataRequest::Run() { const VehicleData& vehicle_data = MessageHelper::vehicle_data(); VehicleData::const_iterator it = vehicle_data.begin(); - smart_objects::SmartObject msg_params = smart_objects::SmartObject( - smart_objects::SmartType_Map); + smart_objects::SmartObject msg_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); - smart_objects::SmartObject response_params = smart_objects::SmartObject( - smart_objects::SmartType_Map); + smart_objects::SmartObject response_params = + smart_objects::SmartObject(smart_objects::SmartType_Map); for (; vehicle_data.end() != it; ++it) { const std::string& key_name = it->first; @@ -130,21 +145,25 @@ void UnsubscribeVehicleDataRequest::Run() { } if (!app->UnsubscribeFromIVI(static_cast<uint32_t>(key_type))) { - LOG4CXX_ERROR(logger_, "Unable to unsubscribe from " - "VehicleDataType: " << key_type); + LOG4CXX_ERROR(logger_, + "Unable to unsubscribe from " + "VehicleDataType: " + << key_type); continue; } - LOG4CXX_DEBUG(logger_, "Unsubscribed app with connection key " - << connection_key() - << " from VehicleDataType: " - << key_type); + LOG4CXX_DEBUG(logger_, + "Unsubscribed app with connection key " + << connection_key() + << " from VehicleDataType: " << key_type); ++unsubscribed_items; if (IsSomeoneSubscribedFor(key_type)) { - LOG4CXX_DEBUG(logger_, "There are another apps still subscribed for " - "VehicleDataType: " << key_type); + LOG4CXX_DEBUG(logger_, + "There are another apps still subscribed for " + "VehicleDataType: " + << key_type); vi_still_subscribed_by_another_apps_.insert(key_type); response_params[key_name][strings::data_type] = key_type; @@ -161,48 +180,46 @@ void UnsubscribeVehicleDataRequest::Run() { bool is_everything_already_unsubscribed = static_cast<uint32_t>(items_to_unsubscribe) == vi_still_subscribed_by_another_apps_.size() + - vi_already_unsubscribed_by_this_app_.size(); + vi_already_unsubscribed_by_this_app_.size(); if (0 == items_to_unsubscribe) { if (HasDisallowedParams()) { SendResponse(false, mobile_apis::Result::DISALLOWED); } else { - SendResponse(false, mobile_apis::Result::INVALID_DATA, - "No data in the request."); + SendResponse( + false, mobile_apis::Result::INVALID_DATA, "No data in the request."); } return; } if (0 == unsubscribed_items) { - SendResponse(false, mobile_apis::Result::IGNORED, - "Was not subscribed on any VehicleData.", &response_params); + SendResponse(false, + mobile_apis::Result::IGNORED, + "Was not subscribed on any VehicleData.", + &response_params); return; } if (is_everything_already_unsubscribed) { mobile_apis::Result::eType result_code = vi_already_unsubscribed_by_this_app_.size() - ? mobile_apis::Result::IGNORED - : mobile_apis::Result::SUCCESS; + ? mobile_apis::Result::IGNORED + : mobile_apis::Result::SUCCESS; - const char* info = - vi_already_unsubscribed_by_this_app_.size() - ? "Already subscribed on some provided VehicleData." - : NULL; + const char* info = vi_already_unsubscribed_by_this_app_.size() + ? "Already subscribed on some provided VehicleData." + : NULL; - SendResponse(true, - result_code, - info, - &response_params); + SendResponse(true, result_code, info, &response_params); return; } #ifdef HMI_DBUS_API - //Generate list of subrequests + // Generate list of subrequests for (size_t i = 0; i < sizeof(subrequests) / sizeof(subrequests[0]); ++i) { const Subrequest& sr = subrequests[i]; - if (true == (*message_)[strings::msg_params].keyExists(sr.str) - && true == (*message_)[strings::msg_params][sr.str].asBool()) { + if (true == (*message_)[strings::msg_params].keyExists(sr.str) && + true == (*message_)[strings::msg_params][sr.str].asBool()) { HmiRequest hmi_request; hmi_request.str = sr.str; hmi_request.func_id = sr.func_id; @@ -213,14 +230,16 @@ void UnsubscribeVehicleDataRequest::Run() { LOG4CXX_INFO(logger_, hmi_requests_.size() << " requests are going to be sent to HMI"); - //Send subrequests + // Send subrequests for (HmiRequests::const_iterator it = hmi_requests_.begin(); - it != hmi_requests_.end(); ++it) + it != hmi_requests_.end(); + ++it) SendHMIRequest(it->func_id, &msg_params, true); #else SendHMIRequest(hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData, - &msg_params, true); -#endif // #ifdef HMI_DBUS_API + &msg_params, + true); +#endif // #ifdef HMI_DBUS_API } void UnsubscribeVehicleDataRequest::on_event(const event_engine::Event& event) { @@ -236,12 +255,12 @@ void UnsubscribeVehicleDataRequest::on_event(const event_engine::Event& event) { #ifdef HMI_DBUS_API for (HmiRequests::iterator it = hmi_requests_.begin(); - it != hmi_requests_.end(); ++it) { - HmiRequest & hmi_request = *it; + it != hmi_requests_.end(); + ++it) { + HmiRequest& hmi_request = *it; if (hmi_request.func_id == event.id()) { - hmi_request.status = - static_cast<hmi_apis::Common_Result::eType>( - message[strings::params][hmi_response::code].asInt()); + hmi_request.status = static_cast<hmi_apis::Common_Result::eType>( + message[strings::params][hmi_response::code].asInt()); if (hmi_apis::Common_Result::SUCCESS == hmi_request.status) hmi_request.value = message[strings::msg_params][hmi_request.str]; hmi_request.complete = true; @@ -252,7 +271,8 @@ void UnsubscribeVehicleDataRequest::on_event(const event_engine::Event& event) { bool any_arg_success = false; mobile_api::Result::eType status = mobile_api::Result::eType::SUCCESS; for (HmiRequests::const_iterator it = hmi_requests_.begin(); - it != hmi_requests_.end(); ++it) { + it != hmi_requests_.end(); + ++it) { if (!it->complete) { all_complete = false; break; @@ -260,20 +280,24 @@ void UnsubscribeVehicleDataRequest::on_event(const event_engine::Event& event) { if (hmi_apis::Common_Result::SUCCESS != it->status) { if (mobile_api::Result::SUCCESS == status) { status = static_cast<mobile_apis::Result::eType>(it->status); - } else if (status - != static_cast<mobile_apis::Result::eType>(it->status)) { + } else if (status != + static_cast<mobile_apis::Result::eType>(it->status)) { status = mobile_api::Result::eType::GENERIC_ERROR; - } LOG4CXX_TRACE(logger_, "Status from HMI: " << it->status << - ", so response status become " << status); + } + LOG4CXX_TRACE(logger_, + "Status from HMI: " << it->status + << ", so response status become " + << status); } else { any_arg_success = true; } } - if (all_complete) { + if (all_complete) { smart_objects::SmartObject response_params(smart_objects::SmartType_Map); if (any_arg_success) { for (HmiRequests::const_iterator it = hmi_requests_.begin(); - it != hmi_requests_.end(); ++it) { + it != hmi_requests_.end(); + ++it) { response_params[it->str] = it->value; } } @@ -286,17 +310,16 @@ void UnsubscribeVehicleDataRequest::on_event(const event_engine::Event& event) { if (true == any_arg_success) { UpdateHash(); } - } + } #else hmi_apis::Common_Result::eType hmi_result = static_cast<hmi_apis::Common_Result::eType>( message[strings::params][hmi_response::code].asInt()); - bool is_succeeded = - Compare<hmi_apis::Common_Result::eType, EQ, ONE>( - hmi_result, - hmi_apis::Common_Result::SUCCESS, - hmi_apis::Common_Result::WARNINGS); + bool is_succeeded = Compare<hmi_apis::Common_Result::eType, EQ, ONE>( + hmi_result, + hmi_apis::Common_Result::SUCCESS, + hmi_apis::Common_Result::WARNINGS); mobile_apis::Result::eType result_code = MessageHelper::HMIToMobileResult(hmi_result); @@ -312,19 +335,19 @@ void UnsubscribeVehicleDataRequest::on_event(const event_engine::Event& event) { if (!vi_still_subscribed_by_another_apps_.empty() || !vi_already_unsubscribed_by_this_app_.empty()) { - AddAlreadyUnsubscribedVI(const_cast<smart_objects::SmartObject&>( - message[strings::msg_params])); + AddAlreadyUnsubscribedVI( + const_cast<smart_objects::SmartObject&>(message[strings::msg_params])); } if (is_succeeded) { SetAllowedToTerminate(false); } - SendResponse(is_succeeded, result_code, return_info, - &(message[strings::msg_params])); + SendResponse( + is_succeeded, result_code, return_info, &(message[strings::msg_params])); if (is_succeeded) { UpdateHash(); } -#endif // #ifdef HMI_DBUS_API +#endif // #ifdef HMI_DBUS_API } struct SubscribedToIVIPredicate { @@ -352,7 +375,7 @@ void UnsubscribeVehicleDataRequest::AddAlreadyUnsubscribedVI( using namespace mobile_apis; VehicleInfoSubscriptions::const_iterator it_same_app = vi_already_unsubscribed_by_this_app_.begin(); - for (;vi_already_unsubscribed_by_this_app_.end() != it_same_app; + for (; vi_already_unsubscribed_by_this_app_.end() != it_same_app; ++it_same_app) { response[*it_same_app][strings::result_code] = VehicleDataResultCode::VDRC_DATA_NOT_SUBSCRIBED; @@ -360,7 +383,7 @@ void UnsubscribeVehicleDataRequest::AddAlreadyUnsubscribedVI( VehicleInfoSubscriptions::const_iterator it_another_app = vi_still_subscribed_by_another_apps_.begin(); - for (;vi_still_subscribed_by_another_apps_.end() != it_another_app; + for (; vi_still_subscribed_by_another_apps_.end() != it_another_app; ++it_another_app) { response[*it_another_app][strings::result_code] = VehicleDataResultCode::VDRC_SUCCESS; @@ -374,13 +397,12 @@ void UnsubscribeVehicleDataRequest::UpdateHash() const { if (application) { application->UpdateHash(); } else { - LOG4CXX_ERROR(logger_, "Application with connection_key = " - << connection_key() <<" doesn't exist."); + LOG4CXX_ERROR(logger_, + "Application with connection_key = " << connection_key() + << " doesn't exist."); } - application_manager_.TerminateRequest(connection_key(), - correlation_id()); + application_manager_.TerminateRequest(connection_key(), correlation_id()); } - } // namespace commands } // namespace application_manager diff --git a/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_response.cc b/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_response.cc index 843a53682e..e06158e4eb 100644 --- a/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_response.cc +++ b/src/components/application_manager/src/commands/mobile/unsubscribe_vehicle_data_response.cc @@ -38,11 +38,9 @@ namespace commands { UnsubscribeVehicleDataResponse::UnsubscribeVehicleDataResponse( const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} + : CommandResponseImpl(message, application_manager) {} -UnsubscribeVehicleDataResponse::~UnsubscribeVehicleDataResponse() { -} +UnsubscribeVehicleDataResponse::~UnsubscribeVehicleDataResponse() {} void UnsubscribeVehicleDataResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); diff --git a/src/components/application_manager/src/commands/mobile/unsubscribe_way_points_request.cc b/src/components/application_manager/src/commands/mobile/unsubscribe_way_points_request.cc index 215d6dadc2..3a0363845d 100644 --- a/src/components/application_manager/src/commands/mobile/unsubscribe_way_points_request.cc +++ b/src/components/application_manager/src/commands/mobile/unsubscribe_way_points_request.cc @@ -6,7 +6,7 @@ namespace application_manager { namespace commands { UnSubscribeWayPointsRequest::UnSubscribeWayPointsRequest( - const MessageSharedPtr &message, ApplicationManager& application_manager) + const MessageSharedPtr& message, ApplicationManager& application_manager) : CommandRequestImpl(message, application_manager) {} UnSubscribeWayPointsRequest::~UnSubscribeWayPointsRequest() {} @@ -14,12 +14,12 @@ UnSubscribeWayPointsRequest::~UnSubscribeWayPointsRequest() {} void UnSubscribeWayPointsRequest::Run() { LOG4CXX_AUTO_TRACE(logger_); - ApplicationSharedPtr app = - application_manager_.application(connection_key()); + ApplicationSharedPtr app = application_manager_.application(connection_key()); if (!app) { - LOG4CXX_ERROR(logger_, "An application with connection key " - << connection_key() << " is not registered."); + LOG4CXX_ERROR(logger_, + "An application with connection key " + << connection_key() << " is not registered."); SendResponse(false, mobile_apis::Result::APPLICATION_NOT_REGISTERED); return; } @@ -29,15 +29,14 @@ void UnSubscribeWayPointsRequest::Run() { return; } - SendHMIRequest(hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints, NULL, - true); + SendHMIRequest( + hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints, NULL, true); } -void UnSubscribeWayPointsRequest::on_event(const event_engine::Event &event) { +void UnSubscribeWayPointsRequest::on_event(const event_engine::Event& event) { LOG4CXX_AUTO_TRACE(logger_); - ApplicationSharedPtr app = - application_manager_.application(connection_key()); - const smart_objects::SmartObject &message = event.smart_object(); + ApplicationSharedPtr app = application_manager_.application(connection_key()); + const smart_objects::SmartObject& message = event.smart_object(); switch (event.id()) { case hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints: { LOG4CXX_INFO(logger_, "Received Navigation_UnSubscribeWayPoints event"); diff --git a/src/components/application_manager/src/commands/mobile/unsubscribe_way_points_response.cc b/src/components/application_manager/src/commands/mobile/unsubscribe_way_points_response.cc index 0e57fe410a..f6430d1f0d 100644 --- a/src/components/application_manager/src/commands/mobile/unsubscribe_way_points_response.cc +++ b/src/components/application_manager/src/commands/mobile/unsubscribe_way_points_response.cc @@ -6,7 +6,7 @@ namespace application_manager { namespace commands { UnsubscribeWayPointsResponse::UnsubscribeWayPointsResponse( - const MessageSharedPtr &message, ApplicationManager& application_manager) + const MessageSharedPtr& message, ApplicationManager& application_manager) : CommandResponseImpl(message, application_manager) {} UnsubscribeWayPointsResponse::~UnsubscribeWayPointsResponse() {} diff --git a/src/components/application_manager/src/commands/mobile/update_turn_list_request.cc b/src/components/application_manager/src/commands/mobile/update_turn_list_request.cc index 02c9e479b7..9b3b221446 100644 --- a/src/components/application_manager/src/commands/mobile/update_turn_list_request.cc +++ b/src/components/application_manager/src/commands/mobile/update_turn_list_request.cc @@ -47,9 +47,9 @@ namespace commands { namespace custom_str = utils::custom_string; -UpdateTurnListRequest::UpdateTurnListRequest(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandRequestImpl(message, application_manager) { -} +UpdateTurnListRequest::UpdateTurnListRequest( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : CommandRequestImpl(message, application_manager) {} UpdateTurnListRequest::~UpdateTurnListRequest() {} @@ -75,8 +75,10 @@ void UpdateTurnListRequest::Run() { // ProcessSoftButtons checks strings on the contents incorrect character mobile_apis::Result::eType processing_result = - MessageHelper::ProcessSoftButtons((*message_)[strings::msg_params], app, - application_manager_.GetPolicyHandler(), application_manager_); + MessageHelper::ProcessSoftButtons((*message_)[strings::msg_params], + app, + application_manager_.GetPolicyHandler(), + application_manager_); if (mobile_apis::Result::SUCCESS != processing_result) { LOG4CXX_ERROR(logger_, "INVALID_DATA!"); @@ -91,7 +93,8 @@ void UpdateTurnListRequest::Run() { if ((turn_list_array[i].keyExists(strings::turn_icon)) && (mobile_apis::Result::SUCCESS != MessageHelper::VerifyImage(turn_list_array[i][strings::turn_icon], - app, application_manager_))) { + app, + application_manager_))) { LOG4CXX_ERROR(logger_, "MessageHelper::VerifyImage return INVALID_DATA"); SendResponse(false, mobile_apis::Result::INVALID_DATA); @@ -221,7 +224,6 @@ bool UpdateTurnListRequest::IsWhiteSpaceExist() { return true; } } - } } return false; diff --git a/src/components/application_manager/src/commands/mobile/update_turn_list_response.cc b/src/components/application_manager/src/commands/mobile/update_turn_list_response.cc index 005e0ad261..d40a4546fc 100644 --- a/src/components/application_manager/src/commands/mobile/update_turn_list_response.cc +++ b/src/components/application_manager/src/commands/mobile/update_turn_list_response.cc @@ -39,12 +39,11 @@ namespace application_manager { namespace commands { -UpdateTurnListResponse::UpdateTurnListResponse(const MessageSharedPtr& message, ApplicationManager& application_manager) - : CommandResponseImpl(message, application_manager) { -} +UpdateTurnListResponse::UpdateTurnListResponse( + const MessageSharedPtr& message, ApplicationManager& application_manager) + : CommandResponseImpl(message, application_manager) {} -UpdateTurnListResponse::~UpdateTurnListResponse() { -} +UpdateTurnListResponse::~UpdateTurnListResponse() {} void UpdateTurnListResponse::Run() { LOG4CXX_AUTO_TRACE(logger_); 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 860df6f8a2..f8b8bc791d 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 @@ -98,7 +98,8 @@ void EventDispatcherImpl::remove_observer(const Event::EventID& event_id, 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())), + std::remove_if( + obs_vec.begin(), obs_vec_it, IdCheckFunctor(observer.id())), obs_vec_it); } } @@ -112,13 +113,12 @@ void EventDispatcherImpl::remove_observer(EventObserver& observer) { } } -void EventDispatcherImpl::remove_observer_from_vector( - EventObserver& observer) { +void EventDispatcherImpl::remove_observer_from_vector(EventObserver& observer) { AutoLock auto_lock(observer_lock_); observers_.erase( - std::remove_if(observers_.begin(), observers_.end(), - IdCheckFunctor(observer.id())), + std::remove_if( + observers_.begin(), observers_.end(), IdCheckFunctor(observer.id())), observers_.end()); } 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 cfb8cc6718..f89f6649b1 100644 --- a/src/components/application_manager/src/event_engine/event_observer.cc +++ b/src/components/application_manager/src/event_engine/event_observer.cc @@ -43,12 +43,13 @@ EventObserver::EventObserver(EventDispatcher& event_dispatcher) id_ = reinterpret_cast<unsigned long>(this); } -EventObserver::~EventObserver() { unsubscribe_from_all_events(); } +EventObserver::~EventObserver() { + unsubscribe_from_all_events(); +} void EventObserver::subscribe_on_event(const Event::EventID& event_id, int32_t hmi_correlation_id) { - event_dispatcher_.add_observer(event_id, hmi_correlation_id, - *this); + event_dispatcher_.add_observer(event_id, hmi_correlation_id, *this); } void EventObserver::unsubscribe_from_event(const Event::EventID& event_id) { diff --git a/src/components/application_manager/src/hmi_capabilities.cc b/src/components/application_manager/src/hmi_capabilities.cc index 0f15d7ea6b..f63e7d5f1a 100644 --- a/src/components/application_manager/src/hmi_capabilities.cc +++ b/src/components/application_manager/src/hmi_capabilities.cc @@ -50,30 +50,27 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager") namespace application_manager { namespace Formatters = NsSmartDeviceLink::NsJSONHandler::Formatters; -std::map<std::string, hmi_apis::Common_VrCapabilities::eType> vr_enum_capabilities = -{ - {"TEXT", hmi_apis::Common_VrCapabilities::VR_TEXT} -}; - -std::map<std::string, hmi_apis::Common_ButtonName::eType> button_enum_name = -{ - {"OK" , hmi_apis::Common_ButtonName::OK}, - {"SEEKLEFT" , hmi_apis::Common_ButtonName::SEEKLEFT}, - {"SEEKRIGHT" , hmi_apis::Common_ButtonName::SEEKRIGHT}, - {"TUNEUP" , hmi_apis::Common_ButtonName::TUNEUP}, - {"TUNEDOWN" , hmi_apis::Common_ButtonName::TUNEDOWN}, - {"PRESET_0" , hmi_apis::Common_ButtonName::PRESET_0}, - {"PRESET_1" , hmi_apis::Common_ButtonName::PRESET_1}, - {"PRESET_2" , hmi_apis::Common_ButtonName::PRESET_2}, - {"PRESET_3" , hmi_apis::Common_ButtonName::PRESET_3}, - {"PRESET_4" , hmi_apis::Common_ButtonName::PRESET_4}, - {"PRESET_5" , hmi_apis::Common_ButtonName::PRESET_5}, - {"PRESET_6" , hmi_apis::Common_ButtonName::PRESET_6}, - {"PRESET_7" , hmi_apis::Common_ButtonName::PRESET_7}, - {"PRESET_8" , hmi_apis::Common_ButtonName::PRESET_8}, - {"PRESET_9" , hmi_apis::Common_ButtonName::PRESET_9}, - {"CUSTOM_BUTTON" , hmi_apis::Common_ButtonName::CUSTOM_BUTTON}, - {"SEARCH" , hmi_apis::Common_ButtonName::SEARCH}, +std::map<std::string, hmi_apis::Common_VrCapabilities::eType> + vr_enum_capabilities = {{"TEXT", hmi_apis::Common_VrCapabilities::VR_TEXT}}; + +std::map<std::string, hmi_apis::Common_ButtonName::eType> button_enum_name = { + {"OK", hmi_apis::Common_ButtonName::OK}, + {"SEEKLEFT", hmi_apis::Common_ButtonName::SEEKLEFT}, + {"SEEKRIGHT", hmi_apis::Common_ButtonName::SEEKRIGHT}, + {"TUNEUP", hmi_apis::Common_ButtonName::TUNEUP}, + {"TUNEDOWN", hmi_apis::Common_ButtonName::TUNEDOWN}, + {"PRESET_0", hmi_apis::Common_ButtonName::PRESET_0}, + {"PRESET_1", hmi_apis::Common_ButtonName::PRESET_1}, + {"PRESET_2", hmi_apis::Common_ButtonName::PRESET_2}, + {"PRESET_3", hmi_apis::Common_ButtonName::PRESET_3}, + {"PRESET_4", hmi_apis::Common_ButtonName::PRESET_4}, + {"PRESET_5", hmi_apis::Common_ButtonName::PRESET_5}, + {"PRESET_6", hmi_apis::Common_ButtonName::PRESET_6}, + {"PRESET_7", hmi_apis::Common_ButtonName::PRESET_7}, + {"PRESET_8", hmi_apis::Common_ButtonName::PRESET_8}, + {"PRESET_9", hmi_apis::Common_ButtonName::PRESET_9}, + {"CUSTOM_BUTTON", hmi_apis::Common_ButtonName::CUSTOM_BUTTON}, + {"SEARCH", hmi_apis::Common_ButtonName::SEARCH}, }; @@ -232,7 +229,7 @@ HMICapabilities::HMICapabilities(ApplicationManager& app_mngr) , is_navigation_supported_(false) , is_phone_call_supported_(false) , app_mngr_(app_mngr) - , hmi_language_handler_(app_mngr_){ + , hmi_language_handler_(app_mngr_) { if (false == app_mngr_.get_settings().launch_hmi()) { is_vr_ready_response_recieved_ = true; is_tts_ready_response_recieved_ = true; @@ -326,14 +323,17 @@ void HMICapabilities::set_is_vr_cooperating(bool value) { is_vr_cooperating_ = value; if (is_vr_cooperating_) { utils::SharedPtr<smart_objects::SmartObject> get_language( - MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetLanguage, app_mngr_)); + MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetLanguage, + app_mngr_)); hmi_language_handler_.set_handle_response_for(*get_language); app_mngr_.ManageHMICommand(get_language); utils::SharedPtr<smart_objects::SmartObject> get_all_languages( - MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetSupportedLanguages, app_mngr_)); + MessageHelper::CreateModuleInfoSO( + hmi_apis::FunctionID::VR_GetSupportedLanguages, app_mngr_)); app_mngr_.ManageHMICommand(get_all_languages); utils::SharedPtr<smart_objects::SmartObject> get_capabilities( - MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetCapabilities, app_mngr_)); + MessageHelper::CreateModuleInfoSO( + hmi_apis::FunctionID::VR_GetCapabilities, app_mngr_)); app_mngr_.ManageHMICommand(get_capabilities); } } @@ -343,17 +343,17 @@ void HMICapabilities::set_is_tts_cooperating(bool value) { is_tts_cooperating_ = value; if (is_tts_cooperating_) { utils::SharedPtr<smart_objects::SmartObject> get_language( - MessageHelper::CreateModuleInfoSO( - hmi_apis::FunctionID::TTS_GetLanguage, app_mngr_)); + MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::TTS_GetLanguage, + app_mngr_)); hmi_language_handler_.set_handle_response_for(*get_language); app_mngr_.ManageHMICommand(get_language); utils::SharedPtr<smart_objects::SmartObject> get_all_languages( - MessageHelper::CreateModuleInfoSO( - hmi_apis::FunctionID::TTS_GetSupportedLanguages, app_mngr_)); + MessageHelper::CreateModuleInfoSO( + hmi_apis::FunctionID::TTS_GetSupportedLanguages, app_mngr_)); app_mngr_.ManageHMICommand(get_all_languages); utils::SharedPtr<smart_objects::SmartObject> get_capabilities( - MessageHelper::CreateModuleInfoSO( - hmi_apis::FunctionID::TTS_GetCapabilities, app_mngr_)); + MessageHelper::CreateModuleInfoSO( + hmi_apis::FunctionID::TTS_GetCapabilities, app_mngr_)); app_mngr_.ManageHMICommand(get_capabilities); } } @@ -363,17 +363,17 @@ void HMICapabilities::set_is_ui_cooperating(bool value) { is_ui_cooperating_ = value; if (is_ui_cooperating_) { utils::SharedPtr<smart_objects::SmartObject> get_language( - MessageHelper::CreateModuleInfoSO( - hmi_apis::FunctionID::UI_GetLanguage, app_mngr_)); + MessageHelper::CreateModuleInfoSO(hmi_apis::FunctionID::UI_GetLanguage, + app_mngr_)); hmi_language_handler_.set_handle_response_for(*get_language); app_mngr_.ManageHMICommand(get_language); utils::SharedPtr<smart_objects::SmartObject> get_all_languages( - MessageHelper::CreateModuleInfoSO( - hmi_apis::FunctionID::UI_GetSupportedLanguages, app_mngr_)); + MessageHelper::CreateModuleInfoSO( + hmi_apis::FunctionID::UI_GetSupportedLanguages, app_mngr_)); app_mngr_.ManageHMICommand(get_all_languages); utils::SharedPtr<smart_objects::SmartObject> get_capabilities( - MessageHelper::CreateModuleInfoSO( - hmi_apis::FunctionID::UI_GetCapabilities, app_mngr_)); + MessageHelper::CreateModuleInfoSO( + hmi_apis::FunctionID::UI_GetCapabilities, app_mngr_)); app_mngr_.ManageHMICommand(get_capabilities); } } @@ -388,8 +388,8 @@ void HMICapabilities::set_is_ivi_cooperating(bool value) { is_ivi_cooperating_ = value; if (is_ivi_cooperating_) { utils::SharedPtr<smart_objects::SmartObject> get_type( - MessageHelper::CreateModuleInfoSO( - hmi_apis::FunctionID::VehicleInfo_GetVehicleType, app_mngr_)); + MessageHelper::CreateModuleInfoSO( + hmi_apis::FunctionID::VehicleInfo_GetVehicleType, app_mngr_)); app_mngr_.ManageHMICommand(get_type); } } @@ -419,24 +419,24 @@ void HMICapabilities::set_active_tts_language( language); } -const hmi_apis::Common_Language::eType -HMICapabilities::active_ui_language() const { +const hmi_apis::Common_Language::eType HMICapabilities::active_ui_language() + const { using namespace hmi_apis; const Common_Language::eType language = hmi_language_handler_.get_language_for(HMILanguageHandler::INTERFACE_UI); return Common_Language::INVALID_ENUM != language ? language : ui_language_; } -const hmi_apis::Common_Language::eType -HMICapabilities::active_vr_language() const { +const hmi_apis::Common_Language::eType HMICapabilities::active_vr_language() + const { using namespace hmi_apis; const Common_Language::eType language = hmi_language_handler_.get_language_for(HMILanguageHandler::INTERFACE_VR); return Common_Language::INVALID_ENUM != language ? language : vr_language_; } -const hmi_apis::Common_Language::eType -HMICapabilities::active_tts_language() const { +const hmi_apis::Common_Language::eType HMICapabilities::active_tts_language() + const { using namespace hmi_apis; const Common_Language::eType language = hmi_language_handler_.get_language_for(HMILanguageHandler::INTERFACE_TTS); @@ -562,10 +562,10 @@ void HMICapabilities::set_navigation_supported(const bool supported) { } void HMICapabilities::set_phone_call_supported(const bool supported) { - is_phone_call_supported_ = supported; + is_phone_call_supported_ = supported; } -void HMICapabilities::Init(resumption::LastState *last_state) { +void HMICapabilities::Init(resumption::LastState* last_state) { hmi_language_handler_.Init(last_state); if (false == load_capabilities_from_file()) { LOG4CXX_ERROR(logger_, "file hmi_capabilities.json was not loaded"); @@ -573,7 +573,7 @@ void HMICapabilities::Init(resumption::LastState *last_state) { LOG4CXX_INFO(logger_, "file hmi_capabilities.json was loaded"); } hmi_language_handler_.set_default_capabilities_languages( - ui_language_, vr_language_, tts_language_); + ui_language_, vr_language_, tts_language_); } bool HMICapabilities::load_capabilities_from_file() { @@ -589,7 +589,6 @@ bool HMICapabilities::load_capabilities_from_file() { } try { - Json::Reader reader_; Json::Value root_json; @@ -643,8 +642,7 @@ bool HMICapabilities::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) { @@ -762,21 +760,18 @@ bool HMICapabilities::load_capabilities_from_file() { if (check_existing_json_member(audio_capabilities, "samplingRate")) { audio_capabilities_so["samplingRate"] = sampling_rate_enum.find(audio_capabilities.get("samplingRate", "") - .asString()) - ->second; + .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; + .asString())->second; } set_audio_pass_thru_capabilities(audio_capabilities_so); } diff --git a/src/components/application_manager/src/hmi_command_factory.cc b/src/components/application_manager/src/hmi_command_factory.cc index f1e2733222..67625fde88 100644 --- a/src/components/application_manager/src/hmi_command_factory.cc +++ b/src/components/application_manager/src/hmi_command_factory.cc @@ -193,7 +193,7 @@ #include "application_manager/commands/hmi/vi_subscribe_vehicle_data_response.h" #include "application_manager/commands/hmi/vi_unsubscribe_vehicle_data_request.h" #include "application_manager/commands/hmi/vi_unsubscribe_vehicle_data_response.h" -#endif // #ifdef HMI_DBUS_API +#endif // #ifdef HMI_DBUS_API #include "application_manager/commands/hmi/vi_get_dtcs_request.h" #include "application_manager/commands/hmi/vi_get_dtcs_response.h" @@ -275,25 +275,27 @@ CREATE_LOGGERPTR_GLOBAL(logger_, "ApplicationManager") namespace application_manager { - CommandSharedPtr HMICommandFactory::CreateCommand( const commands::MessageSharedPtr& message, ApplicationManager& application_manager) { - const int function_id = (*message)[strings::params][strings::function_id] - .asInt(); - LOG4CXX_DEBUG(logger_, - "HMICommandFactory::CreateCommand function_id: " << function_id); + const int function_id = + (*message)[strings::params][strings::function_id].asInt(); + LOG4CXX_DEBUG( + logger_, "HMICommandFactory::CreateCommand function_id: " << function_id); - CommandSharedPtr command( - new application_manager::commands::CommandImpl(message, application_manager)); + CommandSharedPtr command(new application_manager::commands::CommandImpl( + message, application_manager)); bool is_response = false; - const int msg_type = (*message)[strings::params][strings::message_type].asInt(); - if (msg_type == static_cast<int>(application_manager::MessageType::kResponse)) { + const int msg_type = + (*message)[strings::params][strings::message_type].asInt(); + if (msg_type == + static_cast<int>(application_manager::MessageType::kResponse)) { is_response = true; LOG4CXX_DEBUG(logger_, "HMICommandFactory::CreateCommand response"); - } else if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kErrorResponse)) { + } else if ((*message)[strings::params][strings::message_type] == + static_cast<int>( + application_manager::MessageType::kErrorResponse)) { is_response = true; LOG4CXX_DEBUG(logger_, "HMICommandFactory::CreateCommand error response"); } else { @@ -302,1770 +304,1901 @@ CommandSharedPtr HMICommandFactory::CreateCommand( switch (function_id) { case hmi_apis::FunctionID::BasicCommunication_OnStartDeviceDiscovery: { - command.reset(new commands::OnStartDeviceDiscovery(message, application_manager)); + command.reset( + new commands::OnStartDeviceDiscovery(message, application_manager)); break; } case hmi_apis::FunctionID::BasicCommunication_UpdateDeviceList: { if (is_response) { - command.reset(new commands::UpdateDeviceListResponse(message, application_manager)); + command.reset(new commands::UpdateDeviceListResponse( + message, application_manager)); } else { - command.reset(new commands::UpdateDeviceListRequest(message, application_manager)); + command.reset(new commands::UpdateDeviceListRequest( + message, application_manager)); } break; } case hmi_apis::FunctionID::BasicCommunication_ActivateApp: { if (is_response) { - command.reset(new commands::ActivateAppResponse(message, application_manager)); + command.reset( + new commands::ActivateAppResponse(message, application_manager)); } else { - command.reset(new commands::ActivateAppRequest(message, application_manager)); + command.reset( + new commands::ActivateAppRequest(message, application_manager)); } break; } case hmi_apis::FunctionID::BasicCommunication_GetSystemInfo: { if (is_response) { - command.reset(new commands::GetSystemInfoResponse(message, application_manager)); + command.reset( + new commands::GetSystemInfoResponse(message, application_manager)); } else { - command.reset(new commands::GetSystemInfoRequest(message, application_manager)); + command.reset( + new commands::GetSystemInfoRequest(message, application_manager)); } break; } case hmi_apis::FunctionID::SDL_ActivateApp: { if (is_response) { - command.reset(new commands::SDLActivateAppResponse(message, application_manager)); + command.reset( + new commands::SDLActivateAppResponse(message, application_manager)); } else { - command.reset(new commands::SDLActivateAppRequest(message, application_manager)); + command.reset( + new commands::SDLActivateAppRequest(message, application_manager)); } break; } case hmi_apis::FunctionID::BasicCommunication_PolicyUpdate: { if (is_response) { - command.reset(new commands::SDLPolicyUpdateResponse(message, application_manager)); + command.reset(new commands::SDLPolicyUpdateResponse( + message, application_manager)); } else { - command.reset(new commands::SDLPolicyUpdate(message, application_manager)); + command.reset( + new commands::SDLPolicyUpdate(message, application_manager)); } break; } case hmi_apis::FunctionID::SDL_GetURLS: { if (is_response) { - command.reset(new commands::GetUrlsResponse(message, application_manager)); + command.reset( + new commands::GetUrlsResponse(message, application_manager)); } else { command.reset(new commands::GetUrls(message, application_manager)); } break; } case hmi_apis::FunctionID::SDL_OnAppPermissionChanged: { - command.reset(new commands::OnAppPermissionChangedNotification(message, application_manager)); + command.reset(new commands::OnAppPermissionChangedNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::SDL_GetListOfPermissions: { if (is_response) { - command.reset(new commands::SDLGetListOfPermissionsResponse(message, application_manager)); + command.reset(new commands::SDLGetListOfPermissionsResponse( + message, application_manager)); } else { - command.reset(new commands::SDLGetListOfPermissionsRequest(message, application_manager)); + command.reset(new commands::SDLGetListOfPermissionsRequest( + message, application_manager)); } break; } case hmi_apis::FunctionID::SDL_GetUserFriendlyMessage: { if (is_response) { - command.reset(new commands::SDLGetUserFriendlyMessageResponse(message, application_manager)); + command.reset(new commands::SDLGetUserFriendlyMessageResponse( + message, application_manager)); } else { - command.reset(new commands::SDLGetUserFriendlyMessageRequest(message, application_manager)); + command.reset(new commands::SDLGetUserFriendlyMessageRequest( + message, application_manager)); } break; } case hmi_apis::FunctionID::SDL_GetStatusUpdate: { if (is_response) { - command.reset(new commands::SDLGetStatusUpdateResponse(message, application_manager)); + command.reset(new commands::SDLGetStatusUpdateResponse( + message, application_manager)); } else { - command.reset(new commands::SDLGetStatusUpdateRequest(message, application_manager)); + command.reset(new commands::SDLGetStatusUpdateRequest( + message, application_manager)); } break; } case hmi_apis::FunctionID::SDL_OnStatusUpdate: { - command.reset(new commands::OnStatusUpdateNotification(message, application_manager)); + command.reset(new commands::OnStatusUpdateNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::SDL_OnAppPermissionConsent: { - command.reset(new commands::OnAppPermissionConsentNotification(message, application_manager)); + command.reset(new commands::OnAppPermissionConsentNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::BasicCommunication_MixingAudioSupported: { if (is_response) { - command.reset(new commands::MixingAudioSupportedResponse(message, application_manager)); + command.reset(new commands::MixingAudioSupportedResponse( + message, application_manager)); } else { - command.reset(new commands::MixingAudioSupportedRequest(message, application_manager)); + command.reset(new commands::MixingAudioSupportedRequest( + message, application_manager)); } break; } case hmi_apis::FunctionID::BasicCommunication_OnExitAllApplications: { - command.reset(new commands::OnExitAllApplicationsNotification(message, application_manager)); + command.reset(new commands::OnExitAllApplicationsNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::UI_AddCommand: { if (is_response) { - command.reset(new commands::UIAddCommandResponse(message, application_manager)); + command.reset( + new commands::UIAddCommandResponse(message, application_manager)); } else { - command.reset(new commands::UIAddCommandRequest(message, application_manager)); + command.reset( + new commands::UIAddCommandRequest(message, application_manager)); } break; } case hmi_apis::FunctionID::UI_DeleteCommand: { if (is_response) { - command.reset(new commands::UIDeleteCommandResponse(message, application_manager)); + command.reset(new commands::UIDeleteCommandResponse( + message, application_manager)); } else { - command.reset(new commands::UIDeleteCommandRequest(message, application_manager)); + command.reset( + new commands::UIDeleteCommandRequest(message, application_manager)); } break; } case hmi_apis::FunctionID::UI_AddSubMenu: { if (is_response) { - command.reset(new commands::UIAddSubmenuResponse(message, application_manager)); + command.reset( + new commands::UIAddSubmenuResponse(message, application_manager)); } else { - command.reset(new commands::UIAddSubmenuRequest(message, application_manager)); + command.reset( + new commands::UIAddSubmenuRequest(message, application_manager)); } break; } case hmi_apis::FunctionID::UI_DeleteSubMenu: { if (is_response) { - command.reset(new commands::UIDeleteSubmenuResponse(message, application_manager)); + command.reset(new commands::UIDeleteSubmenuResponse( + message, application_manager)); } else { - command.reset(new commands::UIDeleteSubmenuRequest(message, application_manager)); + command.reset( + new commands::UIDeleteSubmenuRequest(message, application_manager)); } break; } case hmi_apis::FunctionID::UI_SetMediaClockTimer: { if (is_response) { - command.reset(new commands::UISetMediaClockTimerResponse(message, application_manager)); + command.reset(new commands::UISetMediaClockTimerResponse( + message, application_manager)); } else { - command.reset(new commands::UISetMediaClockTimerRequest(message, application_manager)); + command.reset(new commands::UISetMediaClockTimerRequest( + message, application_manager)); } break; } case hmi_apis::FunctionID::UI_PerformInteraction: { if (is_response) { - command.reset(new commands::UIPerformInteractionResponse(message, application_manager)); + command.reset(new commands::UIPerformInteractionResponse( + message, application_manager)); } else { - command.reset(new commands::UIPerformInteractionRequest(message, application_manager)); + command.reset(new commands::UIPerformInteractionRequest( + message, application_manager)); } break; } case hmi_apis::FunctionID::UI_SetGlobalProperties: { if (is_response) { - command.reset(new commands::UISetGlobalPropertiesResponse(message, application_manager)); + command.reset(new commands::UISetGlobalPropertiesResponse( + message, application_manager)); } else { - command.reset(new commands::UISetGlobalPropertiesRequest(message, application_manager)); + command.reset(new commands::UISetGlobalPropertiesRequest( + message, application_manager)); } break; } case hmi_apis::FunctionID::UI_ScrollableMessage: { if (is_response) { - command.reset(new commands::UIScrollableMessageResponse(message, application_manager)); + command.reset(new commands::UIScrollableMessageResponse( + message, application_manager)); } else { - command.reset(new commands::UIScrollableMessageRequest(message, application_manager)); + command.reset(new commands::UIScrollableMessageRequest( + message, application_manager)); } break; } case hmi_apis::FunctionID::UI_SetAppIcon: { if (is_response) { - command.reset(new commands::UISetAppIconResponse(message, application_manager)); + command.reset( + new commands::UISetAppIconResponse(message, application_manager)); } else { - command.reset(new commands::UISetAppIconRequest(message, application_manager)); + command.reset( + new commands::UISetAppIconRequest(message, application_manager)); } break; } case hmi_apis::FunctionID::UI_GetSupportedLanguages: { if (is_response) { - command.reset(new commands::UIGetSupportedLanguagesResponse(message, application_manager)); + command.reset(new commands::UIGetSupportedLanguagesResponse( + message, application_manager)); } else { - command.reset(new commands::UIGetSupportedLanguagesRequest(message, application_manager)); + command.reset(new commands::UIGetSupportedLanguagesRequest( + message, application_manager)); } break; } case hmi_apis::FunctionID::UI_GetLanguage: { if (is_response) { - command.reset(new commands::UIGetLanguageResponse(message, application_manager)); + command.reset( + new commands::UIGetLanguageResponse(message, application_manager)); } else { - command.reset(new commands::UIGetLanguageRequest(message, application_manager)); + command.reset( + new commands::UIGetLanguageRequest(message, application_manager)); } break; } case hmi_apis::FunctionID::UI_GetCapabilities: { if (is_response) { - command.reset(new commands::UIGetCapabilitiesResponse(message, application_manager)); + command.reset(new commands::UIGetCapabilitiesResponse( + message, application_manager)); } else { - command.reset(new commands::UIGetCapabilitiesRequest(message, application_manager)); + command.reset(new commands::UIGetCapabilitiesRequest( + message, application_manager)); } break; } case hmi_apis::FunctionID::UI_ChangeRegistration: { if (is_response) { - command.reset(new commands::UIChangeRegistratioResponse(message, application_manager)); + command.reset(new commands::UIChangeRegistratioResponse( + message, application_manager)); } else { - command.reset(new commands::UIChangeRegistrationRequest(message, application_manager)); + command.reset(new commands::UIChangeRegistrationRequest( + message, application_manager)); } break; } case hmi_apis::FunctionID::UI_PerformAudioPassThru: { if (is_response) { - command.reset(new commands::UIPerformAudioPassThruResponse(message, application_manager)); + command.reset(new commands::UIPerformAudioPassThruResponse( + message, application_manager)); } else { - command.reset(new commands::UIPerformAudioPassThruRequest(message, application_manager)); + command.reset(new commands::UIPerformAudioPassThruRequest( + message, application_manager)); } break; } case hmi_apis::FunctionID::UI_EndAudioPassThru: { if (is_response) { - command.reset(new commands::UIEndAudioPassThruResponse(message, application_manager)); + command.reset(new commands::UIEndAudioPassThruResponse( + message, application_manager)); } else { - command.reset(new commands::UIEndAudioPassThruRequest(message, application_manager)); + command.reset(new commands::UIEndAudioPassThruRequest( + message, application_manager)); } break; } case hmi_apis::FunctionID::UI_Alert: { if (is_response) { - command.reset(new commands::UIAlertResponse(message, application_manager)); + command.reset( + new commands::UIAlertResponse(message, application_manager)); } else { - command.reset(new commands::UIAlertRequest(message, application_manager)); + command.reset( + new commands::UIAlertRequest(message, application_manager)); } break; } case hmi_apis::FunctionID::VR_IsReady: { if (is_response) { - command.reset(new commands::VRIsReadyResponse(message, application_manager)); + command.reset( + new commands::VRIsReadyResponse(message, application_manager)); } else { - command.reset(new commands::VRIsReadyRequest(message, application_manager)); + command.reset( + new commands::VRIsReadyRequest(message, application_manager)); } break; } case hmi_apis::FunctionID::VR_AddCommand: { if (is_response) { - command.reset(new commands::VRAddCommandResponse(message, application_manager)); + command.reset( + new commands::VRAddCommandResponse(message, application_manager)); } else { - command.reset(new commands::VRAddCommandRequest(message, application_manager)); + command.reset( + new commands::VRAddCommandRequest(message, application_manager)); } break; } case hmi_apis::FunctionID::VR_DeleteCommand: { if (is_response) { - command.reset(new commands::VRDeleteCommandResponse(message, application_manager)); + command.reset(new commands::VRDeleteCommandResponse( + message, application_manager)); } else { - command.reset(new commands::VRDeleteCommandRequest(message, application_manager)); + command.reset( + new commands::VRDeleteCommandRequest(message, application_manager)); } break; } case hmi_apis::FunctionID::VR_ChangeRegistration: { if (is_response) { - command.reset(new commands::VRChangeRegistrationResponse(message, application_manager)); + command.reset(new commands::VRChangeRegistrationResponse( + message, application_manager)); } else { - command.reset(new commands::VRChangeRegistrationRequest(message, application_manager)); + command.reset(new commands::VRChangeRegistrationRequest( + message, application_manager)); } break; } case hmi_apis::FunctionID::VR_GetSupportedLanguages: { if (is_response) { - command.reset(new commands::VRGetSupportedLanguagesResponse(message, application_manager)); + command.reset(new commands::VRGetSupportedLanguagesResponse( + message, application_manager)); } else { - command.reset(new commands::VRGetSupportedLanguagesRequest(message, application_manager)); + command.reset(new commands::VRGetSupportedLanguagesRequest( + message, application_manager)); } break; } case hmi_apis::FunctionID::VR_GetLanguage: { if (is_response) { - command.reset(new commands::VRGetLanguageResponse(message, application_manager)); + command.reset( + new commands::VRGetLanguageResponse(message, application_manager)); } else { - command.reset(new commands::VRGetLanguageRequest(message, application_manager)); + command.reset( + new commands::VRGetLanguageRequest(message, application_manager)); } break; } case hmi_apis::FunctionID::VR_GetCapabilities: { if (is_response) { - command.reset(new commands::VRGetCapabilitiesResponse(message, application_manager)); + command.reset(new commands::VRGetCapabilitiesResponse( + message, application_manager)); } else { - command.reset(new commands::VRGetCapabilitiesRequest(message, application_manager)); + command.reset(new commands::VRGetCapabilitiesRequest( + message, application_manager)); } break; } case hmi_apis::FunctionID::TTS_IsReady: { if (is_response) { - command.reset(new commands::TTSIsReadyResponse(message, application_manager)); + command.reset( + new commands::TTSIsReadyResponse(message, application_manager)); } else { - command.reset(new commands::TTSIsReadyRequest(message, application_manager)); + command.reset( + new commands::TTSIsReadyRequest(message, application_manager)); } break; } case hmi_apis::FunctionID::TTS_ChangeRegistration: { if (is_response) { - command.reset(new commands::TTSChangeRegistratioResponse(message, application_manager)); + command.reset(new commands::TTSChangeRegistratioResponse( + message, application_manager)); } else { - command.reset(new commands::TTSChangeRegistrationRequest(message, application_manager)); + command.reset(new commands::TTSChangeRegistrationRequest( + message, application_manager)); } break; } case hmi_apis::FunctionID::TTS_GetSupportedLanguages: { if (is_response) { - command.reset(new commands::TTSGetSupportedLanguagesResponse(message, application_manager)); + command.reset(new commands::TTSGetSupportedLanguagesResponse( + message, application_manager)); } else { - command.reset(new commands::TTSGetSupportedLanguagesRequest(message, application_manager)); + command.reset(new commands::TTSGetSupportedLanguagesRequest( + message, application_manager)); } break; } case hmi_apis::FunctionID::TTS_StopSpeaking: { if (is_response) { - command.reset(new commands::TTSStopSpeakingResponse(message, application_manager)); + command.reset(new commands::TTSStopSpeakingResponse( + message, application_manager)); } else { - command.reset(new commands::TTSStopSpeakingRequest(message, application_manager)); + command.reset( + new commands::TTSStopSpeakingRequest(message, application_manager)); } break; } case hmi_apis::FunctionID::TTS_GetLanguage: { if (is_response) { - command.reset(new commands::TTSGetLanguageResponse(message, application_manager)); + command.reset( + new commands::TTSGetLanguageResponse(message, application_manager)); } else { - command.reset(new commands::TTSGetLanguageRequest(message, application_manager)); + command.reset( + new commands::TTSGetLanguageRequest(message, application_manager)); } break; } case hmi_apis::FunctionID::TTS_Speak: { if (is_response) { - command.reset(new commands::TTSSpeakResponse(message, application_manager)); + command.reset( + new commands::TTSSpeakResponse(message, application_manager)); } else { - command.reset(new commands::TTSSpeakRequest(message, application_manager)); + command.reset( + new commands::TTSSpeakRequest(message, application_manager)); } break; } case hmi_apis::FunctionID::TTS_SetGlobalProperties: { if (is_response) { - command.reset(new commands::TTSSetGlobalPropertiesResponse(message, application_manager)); + command.reset(new commands::TTSSetGlobalPropertiesResponse( + message, application_manager)); } else { - command.reset(new commands::TTSSetGlobalPropertiesRequest(message, application_manager)); + command.reset(new commands::TTSSetGlobalPropertiesRequest( + message, application_manager)); } break; } case hmi_apis::FunctionID::TTS_GetCapabilities: { if (is_response) { - command.reset(new commands::TTSGetCapabilitiesResponse(message, application_manager)); + command.reset(new commands::TTSGetCapabilitiesResponse( + message, application_manager)); } else { - command.reset(new commands::TTSGetCapabilitiesRequest(message, application_manager)); + command.reset(new commands::TTSGetCapabilitiesRequest( + message, application_manager)); } break; } case hmi_apis::FunctionID::TTS_Started: { - command.reset(new commands::OnTTSStartedNotification(message, application_manager)); + command.reset( + new commands::OnTTSStartedNotification(message, application_manager)); break; } case hmi_apis::FunctionID::TTS_Stopped: { - command.reset(new commands::OnTTSStoppedNotification(message, application_manager)); + command.reset( + new commands::OnTTSStoppedNotification(message, application_manager)); break; } case hmi_apis::FunctionID::BasicCommunication_OnAppActivated: { - command.reset(new commands::OnAppActivatedNotification(message, application_manager)); + command.reset(new commands::OnAppActivatedNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::BasicCommunication_OnExitApplication: { - command.reset(new commands::OnExitApplicationNotification(message, application_manager)); + command.reset(new commands::OnExitApplicationNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::UI_Show: { if (is_response) { - command.reset(new commands::UIShowResponse(message, application_manager)); + command.reset( + new commands::UIShowResponse(message, application_manager)); } else { - command.reset(new commands::UIShowRequest(message, application_manager)); + command.reset( + new commands::UIShowRequest(message, application_manager)); } break; } case hmi_apis::FunctionID::UI_Slider: { if (is_response) { - command.reset(new commands::UISliderResponse(message, application_manager)); + command.reset( + new commands::UISliderResponse(message, application_manager)); } else { - command.reset(new commands::UISliderRequest(message, application_manager)); + command.reset( + new commands::UISliderRequest(message, application_manager)); } break; } case hmi_apis::FunctionID::UI_ClosePopUp: { if (is_response) { - command.reset(new commands::ClosePopupResponse(message, application_manager)); + command.reset( + new commands::ClosePopupResponse(message, application_manager)); } else { - command.reset(new commands::ClosePopupRequest(message, application_manager)); + command.reset( + new commands::ClosePopupRequest(message, application_manager)); } break; } case hmi_apis::FunctionID::UI_IsReady: { if (is_response) { - command.reset(new commands::UIIsReadyResponse(message, application_manager)); + command.reset( + new commands::UIIsReadyResponse(message, application_manager)); } else { - command.reset(new commands::UIIsReadyRequest(message, application_manager)); + command.reset( + new commands::UIIsReadyRequest(message, application_manager)); } break; } case hmi_apis::FunctionID::VehicleInfo_IsReady: { if (is_response) { - command.reset(new commands::VIIsReadyResponse(message, application_manager)); + command.reset( + new commands::VIIsReadyResponse(message, application_manager)); } else { - command.reset(new commands::VIIsReadyRequest(message, application_manager)); + command.reset( + new commands::VIIsReadyRequest(message, application_manager)); } break; } case hmi_apis::FunctionID::VehicleInfo_ReadDID: { if (is_response) { - command.reset(new commands::VIReadDIDResponse(message, application_manager)); + command.reset( + new commands::VIReadDIDResponse(message, application_manager)); } else { - command.reset(new commands::VIReadDIDRequest(message, application_manager)); + command.reset( + new commands::VIReadDIDRequest(message, application_manager)); } break; } #ifdef HMI_DBUS_API case hmi_apis::FunctionID::VehicleInfo_GetGpsData: { if (is_response) - command.reset( - new commands::VISubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_GetGpsData > (message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_GetGpsData>(message, + application_manager)); else - command.reset( - new commands::VISubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_GetGpsData > (message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_GetGpsData>(message, + application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_GetSpeed: { if (is_response) - command.reset( - new commands::VIGetVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_GetSpeed > (message, application_manager)); + command.reset(new commands::VIGetVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_GetSpeed>(message, + application_manager)); else - command.reset( - new commands::VIGetVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_GetSpeed > (message, application_manager)); + command.reset(new commands::VIGetVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_GetSpeed>(message, + application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_GetRpm: { if (is_response) - command.reset( - new commands::VIGetVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_GetRpm > (message, application_manager)); + command.reset(new commands::VIGetVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_GetRpm>(message, + application_manager)); else - command.reset( - new commands::VIGetVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_GetRpm > (message, application_manager)); + command.reset(new commands::VIGetVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_GetRpm>(message, + application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_GetFuelLevel: { if (is_response) - command.reset( - new commands::VIGetVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_GetFuelLevel > (message, application_manager)); + command.reset(new commands::VIGetVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_GetFuelLevel>( + message, application_manager)); else - command.reset( - new commands::VIGetVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_GetFuelLevel > (message, application_manager)); + command.reset(new commands::VIGetVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_GetFuelLevel>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState: { if (is_response) - command.reset( - new commands::VIGetVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState > (message, application_manager)); + command.reset(new commands::VIGetVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState>( + message, application_manager)); else - command.reset( - new commands::VIGetVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState > (message, application_manager)); + command.reset(new commands::VIGetVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_GetFuelLevelState>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption: { if (is_response) - command.reset( - new commands::VIGetVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption > ( - message, application_manager)); + command.reset(new commands::VIGetVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption>( + message, application_manager)); else - command.reset( - new commands::VIGetVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption > ( - message, application_manager)); + command.reset(new commands::VIGetVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_GetInstantFuelConsumption>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature: { if (is_response) - command.reset( - new commands::VIGetVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature > ( - message, application_manager)); + command.reset(new commands::VIGetVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature>( + message, application_manager)); else - command.reset( - new commands::VIGetVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature > ( - message, application_manager)); + command.reset(new commands::VIGetVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_GetExternalTemperature>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_GetPrndl: { if (is_response) - command.reset( - new commands::VIGetVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_GetPrndl > (message, application_manager)); + command.reset(new commands::VIGetVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_GetPrndl>(message, + application_manager)); else - command.reset( - new commands::VIGetVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_GetPrndl > (message, application_manager)); + command.reset(new commands::VIGetVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_GetPrndl>(message, + application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_GetVin: { if (is_response) - command.reset( - new commands::VIGetVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_GetVin > (message, application_manager)); + command.reset(new commands::VIGetVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_GetVin>(message, + application_manager)); else - command.reset( - new commands::VIGetVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_GetVin > (message, application_manager)); + command.reset(new commands::VIGetVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_GetVin>(message, + application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_GetTirePressure: { if (is_response) - command.reset( - new commands::VIGetVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_GetTirePressure > (message, application_manager)); + command.reset(new commands::VIGetVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_GetTirePressure>( + message, application_manager)); else - command.reset( - new commands::VIGetVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_GetTirePressure > (message, application_manager)); + command.reset(new commands::VIGetVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_GetTirePressure>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_GetOdometer: { if (is_response) - command.reset( - new commands::VIGetVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_GetOdometer > (message, application_manager)); + command.reset(new commands::VIGetVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_GetOdometer>( + message, application_manager)); else - command.reset( - new commands::VIGetVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_GetOdometer > (message, application_manager)); + command.reset(new commands::VIGetVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_GetOdometer>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_GetBeltStatus: { if (is_response) - command.reset( - new commands::VIGetVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_GetBeltStatus > (message, application_manager)); + command.reset(new commands::VIGetVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_GetBeltStatus>( + message, application_manager)); else - command.reset( - new commands::VIGetVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_GetBeltStatus > (message, application_manager)); + command.reset(new commands::VIGetVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_GetBeltStatus>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_GetBodyInformation: { if (is_response) - command.reset( - new commands::VIGetVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_GetBodyInformation > (message, application_manager)); + command.reset(new commands::VIGetVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_GetBodyInformation>( + message, application_manager)); else - command.reset( - new commands::VIGetVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_GetBodyInformation > (message, application_manager)); + command.reset(new commands::VIGetVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_GetBodyInformation>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus: { if (is_response) - command.reset( - new commands::VIGetVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus > (message, application_manager)); + command.reset(new commands::VIGetVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus>( + message, application_manager)); else - command.reset( - new commands::VIGetVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus > (message, application_manager)); + command.reset(new commands::VIGetVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_GetDeviceStatus>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_GetDriverBraking: { if (is_response) - command.reset( - new commands::VIGetVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_GetDriverBraking > (message, application_manager)); + command.reset(new commands::VIGetVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_GetDriverBraking>( + message, application_manager)); else - command.reset( - new commands::VIGetVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_GetDriverBraking > (message, application_manager)); + command.reset(new commands::VIGetVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_GetDriverBraking>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_GetWiperStatus: { if (is_response) - command.reset( - new commands::VIGetVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_GetWiperStatus > (message, application_manager)); + command.reset(new commands::VIGetVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_GetWiperStatus>( + message, application_manager)); else - command.reset( - new commands::VIGetVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_GetWiperStatus > (message, application_manager)); + command.reset(new commands::VIGetVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_GetWiperStatus>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus: { if (is_response) - command.reset( - new commands::VIGetVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus > (message, application_manager)); + command.reset(new commands::VIGetVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus>( + message, application_manager)); else - command.reset( - new commands::VIGetVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus > (message, application_manager)); + command.reset(new commands::VIGetVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_GetHeadLampStatus>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_GetEngineTorque: { if (is_response) - command.reset( - new commands::VIGetVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_GetEngineTorque > (message, application_manager)); + command.reset(new commands::VIGetVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_GetEngineTorque>( + message, application_manager)); else - command.reset( - new commands::VIGetVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_GetEngineTorque > (message, application_manager)); + command.reset(new commands::VIGetVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_GetEngineTorque>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition: { if (is_response) - command.reset( - new commands::VIGetVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition > ( - message, application_manager)); + command.reset(new commands::VIGetVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition>( + message, application_manager)); else - command.reset( - new commands::VIGetVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition > ( - message, application_manager)); + command.reset(new commands::VIGetVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_GetAccPedalPosition>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle: { if (is_response) - command.reset( - new commands::VIGetVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle > ( - message, application_manager)); + command.reset(new commands::VIGetVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle>( + message, application_manager)); else - command.reset( - new commands::VIGetVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle > ( - message, application_manager)); + command.reset(new commands::VIGetVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_GetSteeringWheelAngle>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_GetECallInfo: { if (is_response) - command.reset( - new commands::VIGetVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_GetECallInfo > (message, application_manager)); + command.reset(new commands::VIGetVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_GetECallInfo>( + message, application_manager)); else - command.reset( - new commands::VIGetVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_GetECallInfo > (message, application_manager)); + command.reset(new commands::VIGetVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_GetECallInfo>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus: { if (is_response) - command.reset( - new commands::VIGetVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus > (message, application_manager)); + command.reset(new commands::VIGetVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus>( + message, application_manager)); else - command.reset( - new commands::VIGetVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus > (message, application_manager)); + command.reset(new commands::VIGetVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_GetAirbagStatus>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent: { if (is_response) - command.reset( - new commands::VIGetVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent > (message, application_manager)); + command.reset(new commands::VIGetVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent>( + message, application_manager)); else - command.reset( - new commands::VIGetVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent > (message, application_manager)); + command.reset(new commands::VIGetVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_GetEmergencyEvent>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus: { if (is_response) - command.reset( - new commands::VIGetVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus > ( - message, application_manager)); + command.reset(new commands::VIGetVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus>( + message, application_manager)); else - command.reset( - new commands::VIGetVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus > ( - message, application_manager)); + command.reset(new commands::VIGetVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_GetClusterModeStatus>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_GetMyKey: { if (is_response) - command.reset( - new commands::VIGetVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_GetMyKey > (message, application_manager)); + command.reset(new commands::VIGetVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_GetMyKey>(message, + application_manager)); else - command.reset( - new commands::VIGetVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_GetMyKey > (message, application_manager)); + command.reset(new commands::VIGetVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_GetMyKey>(message, + application_manager)); break; } #else case hmi_apis::FunctionID::VehicleInfo_GetVehicleData: { if (is_response) { - command.reset(new commands::VIGetVehicleDataResponse(message, application_manager)); + command.reset(new commands::VIGetVehicleDataResponse( + message, application_manager)); } else { - command.reset(new commands::VIGetVehicleDataRequest(message, application_manager)); + command.reset(new commands::VIGetVehicleDataRequest( + message, application_manager)); } break; } -#endif // #ifdef HMI_DBUS_API +#endif // #ifdef HMI_DBUS_API case hmi_apis::FunctionID::VehicleInfo_GetDTCs: { if (is_response) { - command.reset(new commands::VIGetDTCsResponse(message, application_manager)); + command.reset( + new commands::VIGetDTCsResponse(message, application_manager)); } else { - command.reset(new commands::VIGetDTCsRequest(message, application_manager)); + command.reset( + new commands::VIGetDTCsRequest(message, application_manager)); } break; } case hmi_apis::FunctionID::VehicleInfo_DiagnosticMessage: { if (is_response) { - command.reset(new commands::VIDiagnosticMessageResponse(message, application_manager)); + command.reset(new commands::VIDiagnosticMessageResponse( + message, application_manager)); } else { - command.reset(new commands::VIDiagnosticMessageRequest(message, application_manager)); + command.reset(new commands::VIDiagnosticMessageRequest( + message, application_manager)); } break; } case hmi_apis::FunctionID::VehicleInfo_GetVehicleType: { if (is_response) { - command.reset(new commands::VIGetVehicleTypeResponse(message, application_manager)); + command.reset(new commands::VIGetVehicleTypeResponse( + message, application_manager)); } else { - command.reset(new commands::VIGetVehicleTypeRequest(message, application_manager)); + command.reset(new commands::VIGetVehicleTypeRequest( + message, application_manager)); } break; } case hmi_apis::FunctionID::Navigation_IsReady: { if (is_response) { - command.reset(new commands::NaviIsReadyResponse(message, application_manager)); + command.reset( + new commands::NaviIsReadyResponse(message, application_manager)); } else { - command.reset(new commands::NaviIsReadyRequest(message, application_manager)); + command.reset( + new commands::NaviIsReadyRequest(message, application_manager)); } break; } case hmi_apis::FunctionID::Navigation_AlertManeuver: { if (is_response) { - command.reset(new commands::NaviAlertManeuverResponse(message, application_manager)); + command.reset(new commands::NaviAlertManeuverResponse( + message, application_manager)); } else { - command.reset(new commands::NaviAlertManeuverRequest(message, application_manager)); + command.reset(new commands::NaviAlertManeuverRequest( + message, application_manager)); } break; } case hmi_apis::FunctionID::Navigation_GetWayPoints: { if (is_response) { - command.reset(new commands::NaviGetWayPointsResponse(message, application_manager)); + command.reset(new commands::NaviGetWayPointsResponse( + message, application_manager)); } else { - command.reset(new commands::NaviGetWayPointsRequest(message, application_manager)); + command.reset(new commands::NaviGetWayPointsRequest( + message, application_manager)); } break; } case hmi_apis::FunctionID::Navigation_UpdateTurnList: { if (is_response) { - command.reset(new commands::NaviUpdateTurnListResponse(message, application_manager)); + command.reset(new commands::NaviUpdateTurnListResponse( + message, application_manager)); } else { - command.reset(new commands::NaviUpdateTurnListRequest(message, application_manager)); + command.reset(new commands::NaviUpdateTurnListRequest( + message, application_manager)); } break; } case hmi_apis::FunctionID::Navigation_ShowConstantTBT: { if (is_response) { - command.reset(new commands::NaviShowConstantTBTResponse(message, application_manager)); + command.reset(new commands::NaviShowConstantTBTResponse( + message, application_manager)); } else { - command.reset(new commands::NaviShowConstantTBTRequest(message, application_manager)); + command.reset(new commands::NaviShowConstantTBTRequest( + message, application_manager)); } break; } case hmi_apis::FunctionID::Navigation_SubscribeWayPoints: { if (is_response) { - command.reset(new commands::NaviSubscribeWayPointsResponse(message, application_manager)); + command.reset(new commands::NaviSubscribeWayPointsResponse( + message, application_manager)); } else { - command.reset(new commands::NaviSubscribeWayPointsRequest(message, application_manager)); + command.reset(new commands::NaviSubscribeWayPointsRequest( + message, application_manager)); } break; } case hmi_apis::FunctionID::Navigation_UnsubscribeWayPoints: { if (is_response) { - command.reset(new commands::NaviUnsubscribeWayPointsResponse(message, application_manager)); + command.reset(new commands::NaviUnsubscribeWayPointsResponse( + message, application_manager)); } else { - command.reset(new commands::NaviUnSubscribeWayPointsRequest(message, application_manager)); + command.reset(new commands::NaviUnSubscribeWayPointsRequest( + message, application_manager)); } break; } case hmi_apis::FunctionID::Buttons_GetCapabilities: { if (is_response) { - command.reset(new commands::ButtonGetCapabilitiesResponse(message, application_manager)); + command.reset(new commands::ButtonGetCapabilitiesResponse( + message, application_manager)); } else { - command.reset(new commands::ButtonGetCapabilitiesRequest(message, application_manager)); + command.reset(new commands::ButtonGetCapabilitiesRequest( + message, application_manager)); } break; } case hmi_apis::FunctionID::SDL_OnAllowSDLFunctionality: { - command.reset(new commands::OnAllowSDLFunctionalityNotification(message, application_manager)); + command.reset(new commands::OnAllowSDLFunctionalityNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::SDL_OnSDLConsentNeeded: { - command.reset(new commands::OnSDLConsentNeededNotification(message, application_manager)); + command.reset(new commands::OnSDLConsentNeededNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::SDL_UpdateSDL: { if (is_response) { - command.reset(new commands::UpdateSDLResponse(message, application_manager)); + command.reset( + new commands::UpdateSDLResponse(message, application_manager)); } else { - command.reset(new commands::UpdateSDLRequest(message, application_manager)); + command.reset( + new commands::UpdateSDLRequest(message, application_manager)); } break; } case hmi_apis::FunctionID::BasicCommunication_OnIgnitionCycleOver: { - command.reset(new commands::OnIgnitionCycleOverNotification(message, application_manager)); + command.reset(new commands::OnIgnitionCycleOverNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::BasicCommunication_OnSystemInfoChanged: { - command.reset(new commands::OnSystemInfoChangedNotification(message, application_manager)); + command.reset(new commands::OnSystemInfoChangedNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::BasicCommunication_OnReady: { - command.reset(new commands::OnReadyNotification(message, application_manager)); + command.reset( + new commands::OnReadyNotification(message, application_manager)); break; } case hmi_apis::FunctionID::BasicCommunication_OnDeviceChosen: { - command.reset(new commands::OnDeviceChosenNotification(message, application_manager)); + command.reset(new commands::OnDeviceChosenNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::UI_OnSystemContext: { - command.reset(new commands::OnSystemContextNotification(message, application_manager)); + command.reset(new commands::OnSystemContextNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::UI_OnDriverDistraction: { - command.reset( - new commands::hmi::OnDriverDistractionNotification(message, application_manager)); + command.reset(new commands::hmi::OnDriverDistractionNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::BasicCommunication_OnUpdateDeviceList: { - command.reset(new commands::OnUpdateDeviceList(message, application_manager)); + command.reset( + new commands::OnUpdateDeviceList(message, application_manager)); break; } case hmi_apis::FunctionID::BasicCommunication_OnAppRegistered: { - command.reset(new commands::OnAppRegisteredNotification(message, application_manager)); + command.reset(new commands::OnAppRegisteredNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::BasicCommunication_OnAppUnregistered: { - command.reset(new commands::OnAppUnregisteredNotification(message, application_manager)); + command.reset(new commands::OnAppUnregisteredNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::BasicCommunication_OnFindApplications: { - command.reset(new commands::OnFindApplications(message, application_manager)); + command.reset( + new commands::OnFindApplications(message, application_manager)); break; } case hmi_apis::FunctionID::BasicCommunication_UpdateAppList: { if (is_response) { - command.reset(new commands::UpdateAppListResponse(message, application_manager)); + command.reset( + new commands::UpdateAppListResponse(message, application_manager)); } else { - command.reset(new commands::UpdateAppListRequest(message, application_manager)); + command.reset( + new commands::UpdateAppListRequest(message, application_manager)); } break; } case hmi_apis::FunctionID::VR_Started: { - command.reset(new commands::OnVRStartedNotification(message, application_manager)); + command.reset( + new commands::OnVRStartedNotification(message, application_manager)); break; } case hmi_apis::FunctionID::VR_Stopped: { - command.reset(new commands::OnVRStoppedNotification(message, application_manager)); + command.reset( + new commands::OnVRStoppedNotification(message, application_manager)); break; } case hmi_apis::FunctionID::VR_OnCommand: { - command.reset(new commands::OnVRCommandNotification(message, application_manager)); + command.reset( + new commands::OnVRCommandNotification(message, application_manager)); break; } case hmi_apis::FunctionID::UI_OnCommand: { - command.reset(new commands::OnUICommandNotification(message, application_manager)); + command.reset( + new commands::OnUICommandNotification(message, application_manager)); break; } case hmi_apis::FunctionID::BasicCommunication_OnAppDeactivated: { - command.reset(new commands::OnAppDeactivatedNotification(message, application_manager)); + command.reset(new commands::OnAppDeactivatedNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::UI_OnLanguageChange: { - command.reset(new commands::OnUILanguageChangeNotification(message, application_manager)); + command.reset(new commands::OnUILanguageChangeNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::VR_OnLanguageChange: { - command.reset(new commands::OnVRLanguageChangeNotification(message, application_manager)); + command.reset(new commands::OnVRLanguageChangeNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::TTS_OnLanguageChange: { - command.reset(new commands::OnTTSLanguageChangeNotification(message, application_manager)); + command.reset(new commands::OnTTSLanguageChangeNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::Buttons_OnButtonEvent: { - command.reset(new commands::hmi::OnButtonEventNotification(message, application_manager)); + command.reset(new commands::hmi::OnButtonEventNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::Buttons_OnButtonPress: { - command.reset(new commands::hmi::OnButtonPressNotification(message, application_manager)); + command.reset(new commands::hmi::OnButtonPressNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::Buttons_OnButtonSubscription: { - command.reset(new commands::hmi::OnButtonSubscriptionNotification(message, application_manager)); + command.reset(new commands::hmi::OnButtonSubscriptionNotification( + message, application_manager)); break; } #ifdef HMI_DBUS_API case hmi_apis::FunctionID::VehicleInfo_SubscribeGps: { if (is_response) - command.reset( - new commands::VISubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeGps > (message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeGps>( + message, application_manager)); else - command.reset( - new commands::VISubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeGps > (message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeGps>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed: { if (is_response) - command.reset( - new commands::VISubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed > (message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed>( + message, application_manager)); else - command.reset( - new commands::VISubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed > (message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeSpeed>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeRpm: { if (is_response) - command.reset( - new commands::VISubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeRpm > (message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeRpm>( + message, application_manager)); else - command.reset( - new commands::VISubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeRpm > (message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeRpm>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel: { if (is_response) - command.reset( - new commands::VISubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel > (message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel>( + message, application_manager)); else - command.reset( - new commands::VISubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel > (message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State: { if (is_response) - command.reset( - new commands::VISubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State > ( - message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State>( + message, application_manager)); else - command.reset( - new commands::VISubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State > ( - message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeFuelLevel_State>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption: { if (is_response) - command.reset( - new commands::VISubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption > ( - message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption>( + message, application_manager)); else - command.reset( - new commands::VISubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption > ( - message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeInstantFuelConsumption>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature: { if (is_response) - command.reset( - new commands::VISubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature > ( - message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature>( + message, application_manager)); else - command.reset( - new commands::VISubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature > ( - message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeExternalTemperature>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribePrndl: { if (is_response) - command.reset( - new commands::VISubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribePrndl > (message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribePrndl>( + message, application_manager)); else - command.reset( - new commands::VISubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribePrndl > (message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribePrndl>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeVin: { if (is_response) - command.reset( - new commands::VISubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeVin > (message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeVin>( + message, application_manager)); else - command.reset( - new commands::VISubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeVin > (message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeVin>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure: { if (is_response) - command.reset( - new commands::VISubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure > ( - message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure>( + message, application_manager)); else - command.reset( - new commands::VISubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure > ( - message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeTirePressure>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer: { if (is_response) - command.reset( - new commands::VISubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer > (message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer>( + message, application_manager)); else - command.reset( - new commands::VISubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer > (message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeOdometer>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus: { if (is_response) - command.reset( - new commands::VISubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus > ( - message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus>( + message, application_manager)); else - command.reset( - new commands::VISubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus > ( - message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeBeltStatus>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation: { if (is_response) - command.reset( - new commands::VISubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation > ( - message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation>( + message, application_manager)); else - command.reset( - new commands::VISubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation > ( - message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeBodyInformation>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus: { if (is_response) - command.reset( - new commands::VISubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus > ( - message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus>( + message, application_manager)); else - command.reset( - new commands::VISubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus > ( - message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeDeviceStatus>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking: { if (is_response) - command.reset( - new commands::VISubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking > ( - message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking>( + message, application_manager)); else - command.reset( - new commands::VISubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking > ( - message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeDriverBraking>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus: { if (is_response) - command.reset( - new commands::VISubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus > ( - message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus>( + message, application_manager)); else - command.reset( - new commands::VISubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus > ( - message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeWiperStatus>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus: { if (is_response) - command.reset( - new commands::VISubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus > ( - message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus>( + message, application_manager)); else - command.reset( - new commands::VISubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus > ( - message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeHeadLampStatus>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque: { if (is_response) - command.reset( - new commands::VISubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque > ( - message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque>( + message, application_manager)); else - command.reset( - new commands::VISubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque > ( - message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeEngineTorque>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition: { if (is_response) - command.reset( - new commands::VISubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition > ( - message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition>( + message, application_manager)); else - command.reset( - new commands::VISubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition > ( - message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeAccPedalPosition>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle: { if (is_response) - command.reset( - new commands::VISubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle > ( - message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle>( + message, application_manager)); else - command.reset( - new commands::VISubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle > ( - message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeSteeringWheelAngle>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo: { if (is_response) - command.reset( - new commands::VISubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo > (message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo>( + message, application_manager)); else - command.reset( - new commands::VISubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo > (message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeECallInfo>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus: { if (is_response) - command.reset( - new commands::VISubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus > ( - message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus>( + message, application_manager)); else - command.reset( - new commands::VISubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus > ( - message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeAirbagStatus>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent: { if (is_response) - command.reset( - new commands::VISubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent > ( - message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent>( + message, application_manager)); else - command.reset( - new commands::VISubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent > ( - message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeEmergencyEvent>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus: { if (is_response) - command.reset( - new commands::VISubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus > ( - message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus>( + message, application_manager)); else - command.reset( - new commands::VISubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus > ( - message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeClusterModeStatus>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey: { if (is_response) - command.reset( - new commands::VISubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey > (message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey>( + message, application_manager)); else - command.reset( - new commands::VISubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey > (message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_SubscribeMyKey>( + message, application_manager)); break; } #else case hmi_apis::FunctionID::VehicleInfo_SubscribeVehicleData: { if (is_response) { - command.reset(new commands::VISubscribeVehicleDataResponse(message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataResponse( + message, application_manager)); } else { - command.reset(new commands::VISubscribeVehicleDataRequest(message, application_manager)); + command.reset(new commands::VISubscribeVehicleDataRequest( + message, application_manager)); } break; } -#endif // #ifdef HMI_DBUS_API +#endif // #ifdef HMI_DBUS_API #ifdef HMI_DBUS_API case hmi_apis::FunctionID::VehicleInfo_UnsubscribeGps: { if (is_response) - command.reset( - new commands::VIUnsubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeGps > (message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeGps>( + message, application_manager)); else - command.reset( - new commands::VIUnsubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeGps > (message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeGps>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeSpeed: { if (is_response) - command.reset( - new commands::VIUnsubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeSpeed > (message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeSpeed>( + message, application_manager)); else - command.reset( - new commands::VIUnsubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeSpeed > (message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeSpeed>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeRpm: { if (is_response) - command.reset( - new commands::VIUnsubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeRpm > (message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeRpm>( + message, application_manager)); else - command.reset( - new commands::VIUnsubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeRpm > (message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeRpm>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel: { if (is_response) - command.reset( - new commands::VIUnsubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel > ( - message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel>( + message, application_manager)); else - command.reset( - new commands::VIUnsubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel > ( - message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel_State: { if (is_response) - command.reset( - new commands::VIUnsubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel_State > ( - message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel_State>( + message, application_manager)); else - command.reset( - new commands::VIUnsubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel_State > ( - message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeFuelLevel_State>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeInstantFuelConsumption: { if (is_response) - command.reset( - new commands::VIUnsubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeInstantFuelConsumption > ( - message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID:: + VehicleInfo_UnsubscribeInstantFuelConsumption>( + message, application_manager)); else - command.reset( - new commands::VIUnsubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeInstantFuelConsumption > ( - message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID:: + VehicleInfo_UnsubscribeInstantFuelConsumption>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeExternalTemperature: { if (is_response) - command.reset( - new commands::VIUnsubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeExternalTemperature > ( - message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeExternalTemperature>( + message, application_manager)); else - command.reset( - new commands::VIUnsubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeExternalTemperature > ( - message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeExternalTemperature>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribePrndl: { if (is_response) - command.reset( - new commands::VIUnsubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribePrndl > (message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribePrndl>( + message, application_manager)); else - command.reset( - new commands::VIUnsubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribePrndl > (message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribePrndl>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeVin: { if (is_response) - command.reset( - new commands::VIUnsubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeVin > (message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeVin>( + message, application_manager)); else - command.reset( - new commands::VIUnsubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeVin > (message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeVin>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeTirePressure: { if (is_response) - command.reset( - new commands::VIUnsubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeTirePressure > ( - message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeTirePressure>( + message, application_manager)); else - command.reset( - new commands::VIUnsubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeTirePressure > ( - message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeTirePressure>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeOdometer: { if (is_response) - command.reset( - new commands::VIUnsubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeOdometer > ( - message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeOdometer>( + message, application_manager)); else - command.reset( - new commands::VIUnsubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeOdometer > ( - message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeOdometer>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeBeltStatus: { if (is_response) - command.reset( - new commands::VIUnsubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeBeltStatus > ( - message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeBeltStatus>( + message, application_manager)); else - command.reset( - new commands::VIUnsubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeBeltStatus > ( - message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeBeltStatus>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeBodyInformation: { if (is_response) - command.reset( - new commands::VIUnsubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeBodyInformation > ( - message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeBodyInformation>( + message, application_manager)); else - command.reset( - new commands::VIUnsubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeBodyInformation > ( - message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeBodyInformation>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeDeviceStatus: { if (is_response) - command.reset( - new commands::VIUnsubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeDeviceStatus > ( - message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeDeviceStatus>( + message, application_manager)); else - command.reset( - new commands::VIUnsubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeDeviceStatus > ( - message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeDeviceStatus>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeDriverBraking: { if (is_response) - command.reset( - new commands::VIUnsubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeDriverBraking > ( - message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeDriverBraking>( + message, application_manager)); else - command.reset( - new commands::VIUnsubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeDriverBraking > ( - message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeDriverBraking>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeWiperStatus: { if (is_response) - command.reset( - new commands::VIUnsubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeWiperStatus > ( - message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeWiperStatus>( + message, application_manager)); else - command.reset( - new commands::VIUnsubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeWiperStatus > ( - message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeWiperStatus>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeHeadLampStatus: { if (is_response) - command.reset( - new commands::VIUnsubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeHeadLampStatus > ( - message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeHeadLampStatus>( + message, application_manager)); else - command.reset( - new commands::VIUnsubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeHeadLampStatus > ( - message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeHeadLampStatus>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeEngineTorque: { if (is_response) - command.reset( - new commands::VIUnsubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeEngineTorque > ( - message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeEngineTorque>( + message, application_manager)); else - command.reset( - new commands::VIUnsubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeEngineTorque > ( - message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeEngineTorque>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeAccPedalPosition: { if (is_response) - command.reset( - new commands::VIUnsubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeAccPedalPosition > ( - message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeAccPedalPosition>( + message, application_manager)); else - command.reset( - new commands::VIUnsubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeAccPedalPosition > ( - message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeAccPedalPosition>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeSteeringWheelAngle: { if (is_response) - command.reset( - new commands::VIUnsubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeSteeringWheelAngle > ( - message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeSteeringWheelAngle>( + message, application_manager)); else - command.reset( - new commands::VIUnsubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeSteeringWheelAngle > ( - message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeSteeringWheelAngle>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeECallInfo: { if (is_response) - command.reset( - new commands::VIUnsubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeECallInfo > ( - message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeECallInfo>( + message, application_manager)); else - command.reset( - new commands::VIUnsubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeECallInfo > ( - message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeECallInfo>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeAirbagStatus: { if (is_response) - command.reset( - new commands::VIUnsubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeAirbagStatus > ( - message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeAirbagStatus>( + message, application_manager)); else - command.reset( - new commands::VIUnsubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeAirbagStatus > ( - message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeAirbagStatus>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeEmergencyEvent: { if (is_response) - command.reset( - new commands::VIUnsubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeEmergencyEvent > ( - message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeEmergencyEvent>( + message, application_manager)); else - command.reset( - new commands::VIUnsubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeEmergencyEvent > ( - message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeEmergencyEvent>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeClusterModeStatus: { if (is_response) - command.reset( - new commands::VIUnsubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeClusterModeStatus > ( - message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeClusterModeStatus>( + message, application_manager)); else - command.reset( - new commands::VIUnsubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeClusterModeStatus > ( - message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeClusterModeStatus>( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_UnsubscribeMyKey: { if (is_response) - command.reset( - new commands::VIUnsubscribeVehicleDataResponseTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeMyKey > (message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataResponseTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeMyKey>( + message, application_manager)); else - command.reset( - new commands::VIUnsubscribeVehicleDataRequestTemplate < - hmi_apis::FunctionID::VehicleInfo_UnsubscribeMyKey > (message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataRequestTemplate< + hmi_apis::FunctionID::VehicleInfo_UnsubscribeMyKey>( + message, application_manager)); break; } #else case hmi_apis::FunctionID::VehicleInfo_UnsubscribeVehicleData: { if (is_response) { - command.reset(new commands::VIUnsubscribeVehicleDataResponse(message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataResponse( + message, application_manager)); } else { - command.reset(new commands::VIUnsubscribeVehicleDataRequest(message, application_manager)); + command.reset(new commands::VIUnsubscribeVehicleDataRequest( + message, application_manager)); } break; } -#endif // #ifdef HMI_DBUS_API +#endif // #ifdef HMI_DBUS_API #ifdef HMI_DBUS_API case hmi_apis::FunctionID::VehicleInfo_OnGpsData: { - command.reset(new commands::OnVIGpsDataNotification(message, application_manager)); + command.reset( + new commands::OnVIGpsDataNotification(message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_OnSpeed: { - command.reset(new commands::OnVISpeedNotification(message, application_manager)); + command.reset( + new commands::OnVISpeedNotification(message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_OnRpm: { - command.reset(new commands::OnVIRpmNotification(message, application_manager)); + command.reset( + new commands::OnVIRpmNotification(message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_OnFuelLevel: { - command.reset(new commands::OnVIFuelLevelNotification(message, application_manager)); + command.reset(new commands::OnVIFuelLevelNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_OnFuelLevelState: { - command.reset(new commands::OnVIFuelLevelStateNotification(message, application_manager)); + command.reset(new commands::OnVIFuelLevelStateNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_OnInstantFuelConsumption: { - command.reset( - new commands::OnVIInstantFuelConsumptionNotification(message, application_manager)); + command.reset(new commands::OnVIInstantFuelConsumptionNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_OnExternalTemperature: { - command.reset(new commands::OnVIExternalTemperatureNotification(message, application_manager)); + command.reset(new commands::OnVIExternalTemperatureNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_OnVin: { - command.reset(new commands::OnVIVinNotification(message, application_manager)); + command.reset( + new commands::OnVIVinNotification(message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_OnPrndl: { - command.reset(new commands::OnVIPrndlNotification(message, application_manager)); + command.reset( + new commands::OnVIPrndlNotification(message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_OnTirePressure: { - command.reset(new commands::OnVITirePressureNotification(message, application_manager)); + command.reset(new commands::OnVITirePressureNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_OnOdometer: { - command.reset(new commands::OnVIOdometerNotification(message, application_manager)); + command.reset( + new commands::OnVIOdometerNotification(message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_OnBeltStatus: { - command.reset(new commands::OnVIBeltStatusNotification(message, application_manager)); + command.reset(new commands::OnVIBeltStatusNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_OnBodyInformation: { - command.reset(new commands::OnVIBodyInformationNotification(message, application_manager)); + command.reset(new commands::OnVIBodyInformationNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_OnDeviceStatus: { - command.reset(new commands::OnVIDeviceStatusNotification(message, application_manager)); + command.reset(new commands::OnVIDeviceStatusNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_OnDriverBraking: { - command.reset(new commands::OnVIDriverBrakingNotification(message, application_manager)); + command.reset(new commands::OnVIDriverBrakingNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_OnWiperStatus: { - command.reset(new commands::OnVIWiperStatusNotification(message, application_manager)); + command.reset(new commands::OnVIWiperStatusNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_OnHeadLampStatus: { - command.reset(new commands::OnVIHeadLampStatusNotification(message, application_manager)); + command.reset(new commands::OnVIHeadLampStatusNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_OnEngineTorque: { - command.reset(new commands::OnVIEngineTorqueNotification(message, application_manager)); + command.reset(new commands::OnVIEngineTorqueNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_OnAccPedalPosition: { - command.reset(new commands::OnVIAccPedalPositionNotification(message, application_manager)); + command.reset(new commands::OnVIAccPedalPositionNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_OnSteeringWheelAngle: { - command.reset(new commands::OnVISteeringWheelAngleNotification(message, application_manager)); + command.reset(new commands::OnVISteeringWheelAngleNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::VehicleInfo_OnMyKey: { - command.reset(new commands::OnVIMyKeyNotification(message, application_manager)); + command.reset( + new commands::OnVIMyKeyNotification(message, application_manager)); break; } #else case hmi_apis::FunctionID::VehicleInfo_OnVehicleData: { - command.reset(new commands::OnVIVehicleDataNotification(message, application_manager)); + command.reset(new commands::OnVIVehicleDataNotification( + message, application_manager)); break; } -#endif // #ifdef HMI_DBUS_API +#endif // #ifdef HMI_DBUS_API case hmi_apis::FunctionID::Navigation_OnTBTClientState: { - command.reset(new commands::OnNaviTBTClientStateNotification(message, application_manager)); + command.reset(new commands::OnNaviTBTClientStateNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::UI_OnKeyboardInput: { - command.reset(new commands::hmi::OnUIKeyBoardInputNotification(message, application_manager)); + command.reset(new commands::hmi::OnUIKeyBoardInputNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::UI_OnTouchEvent: { - command.reset(new commands::hmi::OnUITouchEventNotification(message, application_manager)); + command.reset(new commands::hmi::OnUITouchEventNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::UI_OnResetTimeout: { - command.reset(new commands::hmi::OnUIResetTimeoutNotification(message, application_manager)); + command.reset(new commands::hmi::OnUIResetTimeoutNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::Navigation_StartStream: { if (is_response) { - command.reset(new commands::NaviStartStreamResponse(message, application_manager)); + command.reset(new commands::NaviStartStreamResponse( + message, application_manager)); } else { - command.reset(new commands::NaviStartStreamRequest(message, application_manager)); + command.reset( + new commands::NaviStartStreamRequest(message, application_manager)); } break; } case hmi_apis::FunctionID::Navigation_StopStream: { if (is_response) { - command.reset(new commands::NaviStopStreamResponse(message, application_manager)); + command.reset( + new commands::NaviStopStreamResponse(message, application_manager)); } else { - command.reset(new commands::NaviStopStreamRequest(message, application_manager)); + command.reset( + new commands::NaviStopStreamRequest(message, application_manager)); } break; } case hmi_apis::FunctionID::Navigation_StartAudioStream: { if (is_response) { - command.reset(new commands::AudioStartStreamResponse(message, application_manager)); + command.reset(new commands::AudioStartStreamResponse( + message, application_manager)); } else { - command.reset(new commands::AudioStartStreamRequest(message, application_manager)); + command.reset(new commands::AudioStartStreamRequest( + message, application_manager)); } break; } case hmi_apis::FunctionID::Navigation_StopAudioStream: { if (is_response) { - command.reset(new commands::AudioStopStreamResponse(message, application_manager)); + command.reset(new commands::AudioStopStreamResponse( + message, application_manager)); } else { - command.reset(new commands::AudioStopStreamRequest(message, application_manager)); + command.reset( + new commands::AudioStopStreamRequest(message, application_manager)); } break; } case hmi_apis::FunctionID::Navigation_OnAudioDataStreaming: { - command.reset(new commands::OnAudioDataStreamingNotification(message, application_manager)); + command.reset(new commands::OnAudioDataStreamingNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::Navigation_OnVideoDataStreaming: { - command.reset(new commands::OnVideoDataStreamingNotification(message, application_manager)); + command.reset(new commands::OnVideoDataStreamingNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::VR_PerformInteraction: { if (is_response) { - command.reset(new commands::VRPerformInteractionResponse(message, application_manager)); + command.reset(new commands::VRPerformInteractionResponse( + message, application_manager)); } else { - command.reset(new commands::VRPerformInteractionRequest(message, application_manager)); + command.reset(new commands::VRPerformInteractionRequest( + message, application_manager)); } break; } case hmi_apis::FunctionID::BasicCommunication_OnSystemRequest: { - command.reset(new commands::OnSystemRequestNotification(message, application_manager)); + command.reset(new commands::OnSystemRequestNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::BasicCommunication_OnPutFile: { - command.reset(new commands::OnPutFileNotification(message, application_manager)); + command.reset( + new commands::OnPutFileNotification(message, application_manager)); break; } case hmi_apis::FunctionID::BasicCommunication_OnResumeAudioSource: { - command.reset(new commands::OnResumeAudioSourceNotification(message, application_manager)); + command.reset(new commands::OnResumeAudioSourceNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::UI_SetDisplayLayout: { if (is_response) { - command.reset(new commands::UiSetDisplayLayoutResponse(message, application_manager)); + command.reset(new commands::UiSetDisplayLayoutResponse( + message, application_manager)); } else { - command.reset(new commands::UiSetDisplayLayoutRequest(message, application_manager)); + command.reset(new commands::UiSetDisplayLayoutRequest( + message, application_manager)); } break; } case hmi_apis::FunctionID::BasicCommunication_OnSDLClose: { - command.reset(new commands::OnSDLCloseNotification(message, application_manager)); + command.reset( + new commands::OnSDLCloseNotification(message, application_manager)); break; } case hmi_apis::FunctionID::BasicCommunication_OnSDLPersistenceComplete: { - command.reset(new commands::OnSDLPersistenceCompleteNotification(message, application_manager)); + command.reset(new commands::OnSDLPersistenceCompleteNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::BasicCommunication_OnFileRemoved: { - command.reset(new commands::OnFileRemovedNotification(message, application_manager)); + command.reset(new commands::OnFileRemovedNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::UI_OnRecordStart: { - command.reset(new commands::OnRecordStartdNotification(message, application_manager)); + command.reset(new commands::OnRecordStartdNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::BasicCommunication_SystemRequest: { if (is_response) { - command.reset(new commands::BasicCommunicationSystemResponse(message, application_manager)); + command.reset(new commands::BasicCommunicationSystemResponse( + message, application_manager)); } else { - command.reset(new commands::BasicCommunicationSystemRequest(message, application_manager)); + command.reset(new commands::BasicCommunicationSystemRequest( + message, application_manager)); } break; } case hmi_apis::FunctionID::Navigation_SendLocation: { if (is_response) { - command.reset(new commands::NaviSendLocationResponse(message, application_manager)); + command.reset(new commands::NaviSendLocationResponse( + message, application_manager)); } else { - command.reset(new commands::NaviSendLocationRequest(message, application_manager)); + command.reset(new commands::NaviSendLocationRequest( + message, application_manager)); } break; } case hmi_apis::FunctionID::SDL_AddStatisticsInfo: { - command.reset(new commands::AddStatisticsInfoNotification(message, application_manager)); + command.reset(new commands::AddStatisticsInfoNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::SDL_OnSystemError: { - command.reset(new commands::OnSystemErrorNotification(message, application_manager)); + command.reset(new commands::OnSystemErrorNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::SDL_OnReceivedPolicyUpdate: { - command.reset(new commands::OnReceivedPolicyUpdate(message, application_manager)); + command.reset( + new commands::OnReceivedPolicyUpdate(message, application_manager)); break; } case hmi_apis::FunctionID::SDL_OnPolicyUpdate: { @@ -2073,27 +2206,33 @@ CommandSharedPtr HMICommandFactory::CreateCommand( break; } case hmi_apis::FunctionID::SDL_OnDeviceStateChanged: { - command.reset(new commands::OnDeviceStateChangedNotification(message, application_manager)); + command.reset(new commands::OnDeviceStateChangedNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::TTS_OnResetTimeout: { - command.reset(new commands::hmi::OnTTSResetTimeoutNotification(message, application_manager)); + command.reset(new commands::hmi::OnTTSResetTimeoutNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::BasicCommunication_OnEventChanged: { - command.reset(new commands::OnEventChangedNotification(message, application_manager)); + command.reset(new commands::OnEventChangedNotification( + message, application_manager)); break; } case hmi_apis::FunctionID::BasicCommunication_DialNumber: { if (is_response) { - command.reset(new commands::hmi::DialNumberResponse(message, application_manager)); + command.reset(new commands::hmi::DialNumberResponse( + message, application_manager)); } else { - command.reset(new commands::hmi::DialNumberRequest(message, application_manager)); + command.reset( + new commands::hmi::DialNumberRequest(message, application_manager)); } break; } case hmi_apis::FunctionID::Navigation_OnWayPointChange: { - command.reset(new commands::OnNaviWayPointChangeNotification(message, application_manager)); + command.reset(new commands::OnNaviWayPointChangeNotification( + message, application_manager)); break; } } diff --git a/src/components/application_manager/src/hmi_language_handler.cc b/src/components/application_manager/src/hmi_language_handler.cc index f62c130c42..72ab60eb3a 100644 --- a/src/components/application_manager/src/hmi_language_handler.cc +++ b/src/components/application_manager/src/hmi_language_handler.cc @@ -186,8 +186,9 @@ void HMILanguageHandler::set_handle_response_for( subscribe_on_event(function_id, correlation_id); - LOG4CXX_DEBUG(logger_, "Subscribed for function_id " << function_id << - " and correlation_id " << correlation_id); + LOG4CXX_DEBUG(logger_, + "Subscribed for function_id " + << function_id << " and correlation_id " << correlation_id); } void HMILanguageHandler::set_default_capabilities_languages( @@ -211,7 +212,7 @@ void HMILanguageHandler::set_default_capabilities_languages( } void HMILanguageHandler::SendOnLanguageChangeToMobile( - const uint32_t connection_key) { + const uint32_t connection_key) { LOG4CXX_AUTO_TRACE(logger_); smart_objects::SmartObjectSPtr notification = new smart_objects::SmartObject; @@ -228,8 +229,8 @@ void HMILanguageHandler::SendOnLanguageChangeToMobile( hmi_capabilities.active_ui_language(); message[strings::msg_params][strings::language] = hmi_capabilities.active_vr_language(); - if (application_manager_.ManageMobileCommand( - notification, commands::Command::ORIGIN_SDL)) { + if (application_manager_.ManageMobileCommand(notification, + commands::Command::ORIGIN_SDL)) { LOG4CXX_INFO(logger_, "Mobile command sent"); } else { LOG4CXX_WARN(logger_, "Cannot send mobile command"); @@ -239,28 +240,32 @@ void HMILanguageHandler::SendOnLanguageChangeToMobile( void HMILanguageHandler::VerifyWithPersistedLanguages() { LOG4CXX_AUTO_TRACE(logger_); using namespace helpers; - const HMICapabilities& hmi_capabilities = application_manager_.hmi_capabilities(); + const HMICapabilities& hmi_capabilities = + application_manager_.hmi_capabilities(); // Updated values compared with persisted if (hmi_capabilities.active_ui_language() == persisted_ui_language_ && hmi_capabilities.active_vr_language() == persisted_vr_language_ && hmi_capabilities.active_tts_language() == persisted_tts_language_) { LOG4CXX_INFO(logger_, - "All languages gotten from HMI match to persisted values."); + "All languages gotten from HMI match to persisted values."); return; } - LOG4CXX_INFO(logger_, "Some languages gotten from HMI have " - "mismatch with persisted values."); + LOG4CXX_INFO(logger_, + "Some languages gotten from HMI have " + "mismatch with persisted values."); - const ApplicationSet& accessor = application_manager_.applications().GetData(); + const ApplicationSet& accessor = + application_manager_.applications().GetData(); ApplicationSetIt it = accessor.begin(); for (; accessor.end() != it;) { ApplicationConstSharedPtr app = *it++; - LOG4CXX_INFO(logger_, "Application with app_id " << app->app_id() - << " will be unregistered because of " - "HMI language(s) mismatch."); + LOG4CXX_INFO(logger_, + "Application with app_id " + << app->app_id() << " will be unregistered because of " + "HMI language(s) mismatch."); CheckApplication(std::make_pair(app->app_id(), false)); } @@ -277,17 +282,23 @@ void HMILanguageHandler::HandleWrongLanguageApp(const Apps::value_type& app) { LOG4CXX_AUTO_TRACE(logger_); Apps::iterator it = apps_.find(app.first); if (apps_.end() == it) { - LOG4CXX_DEBUG(logger_, "Application id " << app.first << - " is not found within apps with wrong language."); + LOG4CXX_DEBUG(logger_, + "Application id " + << app.first + << " is not found within apps with wrong language."); return; } - LOG4CXX_INFO(logger_, "Unregistering application with app_id " - << app.first << " because of HMI language(s) mismatch."); + LOG4CXX_INFO(logger_, + "Unregistering application with app_id " + << app.first << " because of HMI language(s) mismatch."); SendOnLanguageChangeToMobile(app.first); - application_manager_.ManageMobileCommand(MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( - app.first, mobile_api::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE), commands::Command::ORIGIN_SDL); + application_manager_.ManageMobileCommand( + MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( + app.first, + mobile_api::AppInterfaceUnregisteredReason::LANGUAGE_CHANGE), + commands::Command::ORIGIN_SDL); application_manager_.UnregisterApplication( app.first, mobile_apis::Result::SUCCESS, false); apps_.erase(it); @@ -303,8 +314,9 @@ void HMILanguageHandler::CheckApplication(const Apps::value_type app) { sync_primitives::AutoLock lock(apps_lock_); Apps::iterator it = apps_.find(app.first); if (apps_.end() == it) { - LOG4CXX_INFO(logger_, "Adding application id " << app.first << - " Application registered: " << app.second); + LOG4CXX_INFO(logger_, + "Adding application id " + << app.first << " Application registered: " << app.second); apps_.insert(app); return; } @@ -318,7 +330,6 @@ void HMILanguageHandler::Init(resumption::LastState* value) { persisted_ui_language_ = get_language_for(INTERFACE_UI); persisted_vr_language_ = get_language_for(INTERFACE_VR); persisted_tts_language_ = get_language_for(INTERFACE_TTS); - } } // namespace application_manager diff --git a/src/components/application_manager/src/hmi_state.cc b/src/components/application_manager/src/hmi_state.cc index 721eb9b063..bad2d8661b 100644 --- a/src/components/application_manager/src/hmi_state.cc +++ b/src/components/application_manager/src/hmi_state.cc @@ -97,8 +97,8 @@ mobile_apis::AudioStreamingState::eType TTSHmiState::audio_streaming_state() AudioStreamingState::eType expected_state = AudioStreamingState::NOT_AUDIBLE; if (app_mngr_.is_attenuated_supported() && AudioStreamingState::NOT_AUDIBLE != parent()->audio_streaming_state() && - Compare<HMILevel::eType, EQ, ONE>(hmi_level(), HMILevel::HMI_FULL, - HMILevel::HMI_LIMITED)) { + Compare<HMILevel::eType, EQ, ONE>( + hmi_level(), HMILevel::HMI_FULL, HMILevel::HMI_LIMITED)) { expected_state = AudioStreamingState::ATTENUATED; } return expected_state; @@ -151,7 +151,7 @@ SafetyModeHmiState::SafetyModeHmiState(uint32_t app_id, DeactivateHMI::DeactivateHMI(uint32_t app_id, const ApplicationManager& app_mngr) -: HmiState(app_id, app_mngr, STATE_ID_DEACTIVATE_HMI) {} + : HmiState(app_id, app_mngr, STATE_ID_DEACTIVATE_HMI) {} mobile_apis::HMILevel::eType DeactivateHMI::hmi_level() const { using namespace helpers; @@ -165,7 +165,7 @@ mobile_apis::HMILevel::eType DeactivateHMI::hmi_level() const { } AudioSource::AudioSource(uint32_t app_id, const ApplicationManager& app_mngr) - : HmiState(app_id, app_mngr, STATE_ID_AUDIO_SOURCE) {} + : HmiState(app_id, app_mngr, STATE_ID_AUDIO_SOURCE) {} mobile_apis::HMILevel::eType AudioSource::hmi_level() const { using namespace mobile_apis; 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 1be6bb6a24..77b6c9d6cc 100644 --- a/src/components/application_manager/src/message_helper/message_helper.cc +++ b/src/components/application_manager/src/message_helper/message_helper.cc @@ -220,19 +220,20 @@ hmi_apis::Common_Language::eType MessageHelper::CommonLanguageFromString( return hmi_apis::Common_Language::INVALID_ENUM; } -smart_objects::SmartObjectSPtr MessageHelper::CreateRequestObject(const uint32_t correlation_id) { +smart_objects::SmartObjectSPtr MessageHelper::CreateRequestObject( + const uint32_t correlation_id) { using namespace smart_objects; SmartObjectSPtr request = utils::MakeShared<SmartObject>(SmartType_Map); - SmartObject& ref = *request; + SmartObject& ref = *request; - ref[strings::params][strings::message_type] = - static_cast<int>(hmi_apis::messageType::request); - ref[strings::params][strings::protocol_version] = - commands::CommandImpl::protocol_version_; - ref[strings::params][strings::protocol_type] = - commands::CommandImpl::hmi_protocol_type_; - ref[strings::params][strings::correlation_id] = correlation_id; + ref[strings::params][strings::message_type] = + static_cast<int>(hmi_apis::messageType::request); + ref[strings::params][strings::protocol_version] = + commands::CommandImpl::protocol_version_; + ref[strings::params][strings::protocol_type] = + commands::CommandImpl::hmi_protocol_type_; + ref[strings::params][strings::correlation_id] = correlation_id; return request; } @@ -250,7 +251,8 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateHashUpdateNotification( return message; } -void MessageHelper::SendHashUpdateNotification(const uint32_t app_id, ApplicationManager& app_mngr) { +void MessageHelper::SendHashUpdateNotification(const uint32_t app_id, + ApplicationManager& app_mngr) { LOG4CXX_AUTO_TRACE(logger_); ApplicationSharedPtr app = app_mngr.application(app_id); if (!app) { @@ -259,19 +261,21 @@ void MessageHelper::SendHashUpdateNotification(const uint32_t app_id, Applicatio } smart_objects::SmartObjectSPtr so = CreateHashUpdateNotification(app_id); PrintSmartObject(*so); - if (!app_mngr.ManageMobileCommand( - so, commands::Command::ORIGIN_SDL)) { + if (!app_mngr.ManageMobileCommand(so, commands::Command::ORIGIN_SDL)) { LOG4CXX_ERROR(logger_, "Failed to send HashUpdate notification."); return; } app_mngr.resume_controller().ApplicationsDataUpdated(); } -smart_objects::SmartObjectSPtr MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile(int32_t connection_key, +smart_objects::SmartObjectSPtr +MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( + int32_t connection_key, mobile_api::AppInterfaceUnregisteredReason::eType reason) { LOG4CXX_AUTO_TRACE(logger_); - smart_objects::SmartObjectSPtr notification = utils::MakeShared<smart_objects::SmartObject>(); + smart_objects::SmartObjectSPtr notification = + utils::MakeShared<smart_objects::SmartObject>(); smart_objects::SmartObject& message = *notification; message[strings::params][strings::function_id] = static_cast<int32_t>( @@ -462,8 +466,9 @@ static std::map<std::string, uint16_t> vehicle_data_args = #endif void MessageHelper::CreateGetVehicleDataRequest( - const uint32_t correlation_id, const std::vector<std::string>& params, - ApplicationManager& app_mngr) { + const uint32_t correlation_id, + const std::vector<std::string>& params, + ApplicationManager& app_mngr) { LOG4CXX_AUTO_TRACE(logger_); #ifdef HMI_DBUS_API for (std::vector<std::string>::const_iterator it = params.begin(); @@ -536,7 +541,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateBlockedByPoliciesResponse( smart_objects::SmartObjectSPtr MessageHelper::CreateDeviceListSO( const connection_handler::DeviceMap& devices, const policy::PolicyHandlerInterface& policy_handler, - ApplicationManager& app_mngr) { + ApplicationManager& app_mngr) { LOG4CXX_AUTO_TRACE(logger_); smart_objects::SmartObjectSPtr device_list_so = utils::MakeShared<smart_objects::SmartObject>( @@ -560,8 +565,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateDeviceListSO( list_so[index][strings::isSDLAllowed] = policy::DeviceConsent::kDeviceAllowed == device_consent; list_so[index][strings::transport_type] = - app_mngr.GetDeviceTransportType( - d.connection_type()); + app_mngr.GetDeviceTransportType(d.connection_type()); ++index; } return device_list_so; @@ -604,7 +608,8 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateSetAppIcon( return set_icon; } -bool MessageHelper::SendIVISubscribtions(const uint32_t app_id, ApplicationManager& app_mngr) { +bool MessageHelper::SendIVISubscribtions(const uint32_t app_id, + ApplicationManager& app_mngr) { LOG4CXX_AUTO_TRACE(logger_); bool result = true; @@ -615,7 +620,8 @@ bool MessageHelper::SendIVISubscribtions(const uint32_t app_id, ApplicationManag return result; } - smart_objects::SmartObjectList requests = GetIVISubscriptionRequests(app, app_mngr); + smart_objects::SmartObjectList requests = + GetIVISubscriptionRequests(app, app_mngr); for (smart_objects::SmartObjectList::const_iterator it = requests.begin(); it != requests.end(); ++it) { @@ -678,7 +684,8 @@ smart_objects::SmartObjectList MessageHelper::GetIVISubscriptionRequests( void MessageHelper::SendOnButtonSubscriptionNotification( uint32_t app_id, hmi_apis::Common_ButtonName::eType button, - bool is_subscribed, ApplicationManager& app_mngr) { + bool is_subscribed, + ApplicationManager& app_mngr) { using namespace smart_objects; using namespace hmi_apis; LOG4CXX_AUTO_TRACE(logger_); @@ -728,16 +735,17 @@ void MessageHelper::SendAllOnButtonSubscriptionNotificationsForApp( ButtonSubscriptions::iterator it = subscriptions.begin(); for (; subscriptions.end() != it; ++it) { SendOnButtonSubscriptionNotification( - app->hmi_app_id(), - static_cast<Common_ButtonName::eType>(*it), - true, - app_mngr); + app->hmi_app_id(), + static_cast<Common_ButtonName::eType>(*it), + true, + app_mngr); } } -void MessageHelper::SendSetAppIcon(const uint32_t app_id, - const std::string& icon_path, - application_manager::ApplicationManager& application_manager) { +void MessageHelper::SendSetAppIcon( + const uint32_t app_id, + const std::string& icon_path, + application_manager::ApplicationManager& application_manager) { using namespace smart_objects; SmartObjectSPtr set_app_icon = @@ -759,7 +767,8 @@ void MessageHelper::SendSetAppIcon(const uint32_t app_id, } } -void MessageHelper::SendAppDataToHMI(ApplicationConstSharedPtr app, ApplicationManager& app_man) { +void MessageHelper::SendAppDataToHMI(ApplicationConstSharedPtr app, + ApplicationManager& app_man) { LOG4CXX_AUTO_TRACE(logger_); if (app) { SendSetAppIcon(app, app->app_icon_path(), app_man); @@ -768,14 +777,15 @@ void MessageHelper::SendAppDataToHMI(ApplicationConstSharedPtr app, ApplicationM } } -void MessageHelper::SendGlobalPropertiesToHMI(ApplicationConstSharedPtr app, ApplicationManager& app_mngr) { +void MessageHelper::SendGlobalPropertiesToHMI(ApplicationConstSharedPtr app, + ApplicationManager& app_mngr) { if (!app.valid()) { LOG4CXX_ERROR(logger_, "Invalid application"); return; } - smart_objects::SmartObjectList requests = - CreateGlobalPropertiesRequestsToHMI(app, app_mngr.GetNextHMICorrelationID()); + smart_objects::SmartObjectList requests = CreateGlobalPropertiesRequestsToHMI( + app, app_mngr.GetNextHMICorrelationID()); for (smart_objects::SmartObjectList::const_iterator it = requests.begin(); it != requests.end(); ++it) { @@ -784,8 +794,8 @@ void MessageHelper::SendGlobalPropertiesToHMI(ApplicationConstSharedPtr app, App } smart_objects::SmartObjectList -MessageHelper::CreateGlobalPropertiesRequestsToHMI(ApplicationConstSharedPtr app, - const uint32_t correlation_id) { +MessageHelper::CreateGlobalPropertiesRequestsToHMI( + ApplicationConstSharedPtr app, const uint32_t correlation_id) { LOG4CXX_AUTO_TRACE(logger_); smart_objects::SmartObjectList requests; @@ -865,7 +875,8 @@ void MessageHelper::SendTTSGlobalProperties(ApplicationSharedPtr app, if (!app) { return; } - smart_objects::SmartObjectSPtr tts_global_properties = CreateRequestObject(app_man.GetNextHMICorrelationID()); + smart_objects::SmartObjectSPtr tts_global_properties = + CreateRequestObject(app_man.GetNextHMICorrelationID()); if (tts_global_properties) { smart_objects::SmartObject& so_to_send = *tts_global_properties; so_to_send[strings::params][strings::function_id] = @@ -942,7 +953,8 @@ smart_objects::SmartObjectList MessageHelper::CreateShowRequestToHMI( } if (app->show_command()) { - smart_objects::SmartObjectSPtr ui_show = CreateRequestObject(correlation_id); + smart_objects::SmartObjectSPtr ui_show = + CreateRequestObject(correlation_id); (*ui_show)[strings::params][strings::function_id] = static_cast<int>(hmi_apis::FunctionID::UI_Show); @@ -952,11 +964,13 @@ smart_objects::SmartObjectList MessageHelper::CreateShowRequestToHMI( return requests; } -void MessageHelper::SendShowRequestToHMI(ApplicationConstSharedPtr app, ApplicationManager& app_mngr) { +void MessageHelper::SendShowRequestToHMI(ApplicationConstSharedPtr app, + ApplicationManager& app_mngr) { if (!app) { return; } - smart_objects::SmartObjectList shows = CreateShowRequestToHMI(app, app_mngr.GetNextHMICorrelationID()); + smart_objects::SmartObjectList shows = + CreateShowRequestToHMI(app, app_mngr.GetNextHMICorrelationID()); for (smart_objects::SmartObjectList::const_iterator it = shows.begin(); it != shows.end(); @@ -990,7 +1004,8 @@ void MessageHelper::SendAddCommandRequestToHMI(ApplicationConstSharedPtr app, if (!app) { return; } - smart_objects::SmartObjectList requests = CreateAddCommandRequestToHMI(app, app_man); + smart_objects::SmartObjectList requests = + CreateAddCommandRequestToHMI(app, app_man); for (smart_objects::SmartObjectList::iterator it = requests.begin(); it != requests.end(); ++it) { @@ -1012,7 +1027,8 @@ smart_objects::SmartObjectList MessageHelper::CreateAddCommandRequestToHMI( for (; commands.end() != i; ++i) { // UI Interface if ((*i->second).keyExists(strings::menu_params)) { - smart_objects::SmartObjectSPtr ui_command = CreateRequestObject(app_mngr.GetNextHMICorrelationID()); + smart_objects::SmartObjectSPtr ui_command = + CreateRequestObject(app_mngr.GetNextHMICorrelationID()); if (!ui_command) { return requests; } @@ -1064,7 +1080,8 @@ MessageHelper::CreateAddVRCommandRequestFromChoiceToHMI( (*(it->second))[strings::grammar_id].asUInt(); const size_t size = (*(it->second))[strings::choice_set].length(); for (size_t j = 0; j < size; ++j) { - smart_objects::SmartObjectSPtr vr_command = CreateRequestObject(app_mngr.GetNextHMICorrelationID()); + smart_objects::SmartObjectSPtr vr_command = + CreateRequestObject(app_mngr.GetNextHMICorrelationID()); if (!vr_command) { return requests; } @@ -1095,7 +1112,7 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateChangeRegistration( const int32_t function_id, const int32_t language, const uint32_t app_id, - const smart_objects::SmartObject* app_types, + const smart_objects::SmartObject* app_types, ApplicationManager& app_mngr) { smart_objects::SmartObjectSPtr command = CreateRequestObject(app_mngr.GetNextHMICorrelationID()); @@ -1130,8 +1147,8 @@ void MessageHelper::SendUIChangeRegistrationRequestToHMI( CreateChangeRegistration(hmi_apis::FunctionID::UI_ChangeRegistration, app->ui_language(), app->app_id(), - app->app_types(), - app_mngr); + app->app_types(), + app_mngr); if (ui_command) { app_mngr.ManageHMICommand(ui_command); @@ -1148,7 +1165,9 @@ void MessageHelper::SendChangeRegistrationRequestToHMI( smart_objects::SmartObjectSPtr vr_command = CreateChangeRegistration(hmi_apis::FunctionID::VR_ChangeRegistration, app->language(), - app->app_id(), NULL, app_mngr); + app->app_id(), + NULL, + app_mngr); if (vr_command) { app_mngr.ManageHMICommand(vr_command); @@ -1159,7 +1178,9 @@ void MessageHelper::SendChangeRegistrationRequestToHMI( smart_objects::SmartObjectSPtr tts_command = CreateChangeRegistration(hmi_apis::FunctionID::TTS_ChangeRegistration, app->language(), - app->app_id(), NULL, app_mngr); + app->app_id(), + NULL, + app_mngr); if (tts_command) { app_mngr.ManageHMICommand(tts_command); @@ -1170,7 +1191,9 @@ void MessageHelper::SendChangeRegistrationRequestToHMI( smart_objects::SmartObjectSPtr ui_command = CreateChangeRegistration(hmi_apis::FunctionID::UI_ChangeRegistration, app->ui_language(), - app->app_id(), NULL, app_mngr); + app->app_id(), + NULL, + app_mngr); if (ui_command) { app_mngr.ManageHMICommand(ui_command); @@ -1191,8 +1214,10 @@ void MessageHelper::SendAddVRCommandToHMI( smart_objects::SmartObjectSPtr MessageHelper::CreateAddVRCommandToHMI( const uint32_t cmd_id, const smart_objects::SmartObject& vr_commands, - uint32_t app_id, ApplicationManager& app_mngr) { - smart_objects::SmartObjectSPtr vr_command = CreateRequestObject(app_mngr.GetNextHMICorrelationID()); + uint32_t app_id, + ApplicationManager& app_mngr) { + smart_objects::SmartObjectSPtr vr_command = + CreateRequestObject(app_mngr.GetNextHMICorrelationID()); if (!vr_command) { return NULL; } @@ -1209,7 +1234,8 @@ smart_objects::SmartObjectSPtr MessageHelper::CreateAddVRCommandToHMI( if (0 < app_id) { msg_params[strings::app_id] = app_id; } - msg_params[strings::grammar_id] = app_mngr.application(app_id)->get_grammar_id(); + msg_params[strings::grammar_id] = + app_mngr.application(app_id)->get_grammar_id(); msg_params[strings::type] = hmi_apis::Common_VRCommandType::Command; (*vr_command)[strings::msg_params] = msg_params; @@ -1282,8 +1308,7 @@ bool MessageHelper::CreateHMIApplicationStruct( policy::DeviceConsent::kDeviceAllowed == device_consent; message[strings::device_info][strings::transport_type] = - app_mngr.GetDeviceTransportType( - transport_type); + app_mngr.GetDeviceTransportType(transport_type); return true; } @@ -1364,7 +1389,7 @@ smart_objects::SmartObjectSPtr MessageHelper::GetBCActivateAppRequestToHMI( const policy::PolicyHandlerInterface& policy_handler, hmi_apis::Common_HMILevel::eType level, bool send_policy_priority, - ApplicationManager& app_mngr) { + ApplicationManager& app_mngr) { DCHECK_OR_RETURN(app, smart_objects::SmartObjectSPtr()); const uint32_t correlation_id = app_mngr.GetNextHMICorrelationID(); @@ -1381,14 +1406,14 @@ smart_objects::SmartObjectSPtr MessageHelper::GetBCActivateAppRequestToHMI( std::string priority; // TODO(KKolodiy): need remove method policy_manager - policy_handler.GetPriority(app->policy_app_id(), - &priority); + policy_handler.GetPriority(app->policy_app_id(), &priority); // According SDLAQ-CRS-2794 // SDL have to send ActivateApp without "proirity" parameter to HMI. // in case of unconsented device const std::string& mac_adress = app->mac_address(); - policy::DeviceConsent consent = policy_handler.GetUserConsentForDevice(mac_adress); + policy::DeviceConsent consent = + policy_handler.GetUserConsentForDevice(mac_adress); if (!priority.empty() && (policy::DeviceConsent::kDeviceAllowed == consent)) { (*message)[strings::msg_params][strings::priority] = @@ -1407,8 +1432,8 @@ smart_objects::SmartObjectSPtr MessageHelper::GetBCActivateAppRequestToHMI( void MessageHelper::SendOnResumeAudioSourceToHMI(const uint32_t app_id, ApplicationManager& app_mngr) { LOG4CXX_WARN(logger_, "SendOnResumeAudioSourceToHMI app_id: " << app_id); - application_manager::ApplicationConstSharedPtr app = app_mngr.application( - app_id); + application_manager::ApplicationConstSharedPtr app = + app_mngr.application(app_id); if (!app) { LOG4CXX_WARN(logger_, "Invalid app_id: " << app_id); return; @@ -1430,8 +1455,8 @@ void MessageHelper::SendOnResumeAudioSourceToHMI(const uint32_t app_id, } void MessageHelper::SendSDLActivateAppResponse( - policy::AppPermissions& permissions, - const uint32_t correlation_id, + policy::AppPermissions& permissions, + const uint32_t correlation_id, ApplicationManager& app_mngr) { smart_objects::SmartObjectSPtr message = utils::MakeShared<smart_objects::SmartObject>( @@ -1480,8 +1505,7 @@ void MessageHelper::SendSDLActivateAppResponse( } void MessageHelper::SendOnSDLConsentNeeded( - const policy::DeviceParams& device_info, - ApplicationManager& app_man) { + const policy::DeviceParams& device_info, ApplicationManager& app_man) { smart_objects::SmartObjectSPtr message = utils::MakeShared<smart_objects::SmartObject>( smart_objects::SmartType_Map); @@ -1737,9 +1761,10 @@ void MessageHelper::SendAudioStopStream(const int32_t app_id, app_mngr.ManageHMICommand(stop_stream); } -void MessageHelper::SendOnDataStreaming(const protocol_handler::ServiceType service, - const bool available, - ApplicationManager& app_mngr) { +void MessageHelper::SendOnDataStreaming( + const protocol_handler::ServiceType service, + const bool available, + ApplicationManager& app_mngr) { using namespace protocol_handler; using namespace helpers; @@ -1795,13 +1820,13 @@ bool MessageHelper::SendUnsubscribedWayPoints(ApplicationManager& app_mngr) { void MessageHelper::SendPolicySnapshotNotification( uint32_t connection_key, const std::vector<uint8_t>& policy_data, - const std::string& url, + const std::string& url, ApplicationManager& app_mngr) { - smart_objects::SmartObject content(smart_objects::SmartType_Map); if (!url.empty()) { - content[strings::msg_params][strings::url] = url; // Doesn't work with mobile_notification::syncp_url ("URL") + content[strings::msg_params][strings::url] = + url; // Doesn't work with mobile_notification::syncp_url ("URL") } else { LOG4CXX_WARN(logger_, "No service URLs"); } @@ -1817,7 +1842,7 @@ void MessageHelper::SendPolicySnapshotNotification( } void MessageHelper::SendSystemRequestNotification( - const uint32_t connection_key, + const uint32_t connection_key, smart_objects::SmartObject& content, ApplicationManager& app_mngr) { content[strings::params][strings::function_id] = @@ -1836,20 +1861,19 @@ void MessageHelper::SendSystemRequestNotification( #endif DCHECK(app_mngr.ManageMobileCommand( - utils::MakeShared<smart_objects::SmartObject>(content), - commands::Command::ORIGIN_SDL)); + utils::MakeShared<smart_objects::SmartObject>(content), + commands::Command::ORIGIN_SDL)); } void MessageHelper::SendLaunchApp(const uint32_t connection_key, const std::string& urlSchema, - const std::string& packageName, + const std::string& packageName, ApplicationManager& app_mngr) { using namespace mobile_apis; using namespace smart_objects; SmartObject content(SmartType_Map); - content[strings::msg_params][strings::request_type] = - RequestType::LAUNCH_APP; + content[strings::msg_params][strings::request_type] = RequestType::LAUNCH_APP; content[strings::msg_params][strings::app_id] = connection_key; if (!urlSchema.empty()) { content[strings::msg_params][strings::url] = urlSchema; @@ -1860,19 +1884,15 @@ void MessageHelper::SendLaunchApp(const uint32_t connection_key, SendSystemRequestNotification(connection_key, content, app_mngr); } -void MessageHelper::SendQueryApps( - const uint32_t connection_key, - ApplicationManager& app_mngr) { +void MessageHelper::SendQueryApps(const uint32_t connection_key, + ApplicationManager& app_mngr) { using namespace mobile_apis; - policy::PolicyHandlerInterface& policy_handler = - app_mngr.GetPolicyHandler(); + policy::PolicyHandlerInterface& policy_handler = app_mngr.GetPolicyHandler(); smart_objects::SmartObject content(smart_objects::SmartType_Map); - content[strings::msg_params][strings::request_type] = - RequestType::QUERY_APPS; - content[strings::msg_params][strings::url] = - policy_handler.RemoteAppsUrl(); + content[strings::msg_params][strings::request_type] = RequestType::QUERY_APPS; + content[strings::msg_params][strings::url] = policy_handler.RemoteAppsUrl(); content[strings::msg_params][strings::timeout] = policy_handler.TimeoutExchange(); @@ -1902,8 +1922,9 @@ void MessageHelper::SendQueryApps( } void MessageHelper::SendOnPermissionsChangeNotification( - uint32_t connection_key, const policy::Permissions& permissions, ApplicationManager& app_mngr) { - + uint32_t connection_key, + const policy::Permissions& permissions, + ApplicationManager& app_mngr) { smart_objects::SmartObject content(smart_objects::SmartType_Map); content[strings::params][strings::function_id] = @@ -2039,9 +2060,8 @@ void MessageHelper::FillAppRevokedPermissions( void MessageHelper::SendOnAppPermissionsChangedNotification( const uint32_t connection_key, - const policy::AppPermissions& permissions, - ApplicationManager& app_mngr) { - + const policy::AppPermissions& permissions, + ApplicationManager& app_mngr) { smart_objects::SmartObject message(smart_objects::SmartType_Map); message[strings::params][strings::function_id] = @@ -2075,7 +2095,8 @@ void MessageHelper::SendOnAppPermissionsChangedNotification( } if (permissions.requestTypeChanged) { smart_objects::SmartObject request_types_array( - smart_objects::SmartType_Array);; + smart_objects::SmartType_Array); + ; for (uint16_t index = 0; index < permissions.requestType.size(); ++index) { request_types_array[index] = permissions.requestType[index]; } @@ -2083,7 +2104,7 @@ void MessageHelper::SendOnAppPermissionsChangedNotification( } app_mngr.ManageHMICommand( - utils::MakeShared<smart_objects::SmartObject>(message)); + utils::MakeShared<smart_objects::SmartObject>(message)); } void MessageHelper::SendGetStatusUpdateResponse(const std::string& status, @@ -2159,11 +2180,13 @@ void MessageHelper::SendGetSystemInfoRequest(ApplicationManager& app_mngr) { } mobile_apis::Result::eType MessageHelper::VerifyImageFiles( - smart_objects::SmartObject& message, ApplicationConstSharedPtr app, - ApplicationManager& app_mngr) { + smart_objects::SmartObject& message, + ApplicationConstSharedPtr app, + ApplicationManager& app_mngr) { if (NsSmartDeviceLink::NsSmartObjects::SmartType_Array == message.getType()) { for (uint32_t i = 0; i < message.length(); ++i) { - mobile_apis::Result::eType res = VerifyImageFiles(message[i], app, app_mngr); + mobile_apis::Result::eType res = + VerifyImageFiles(message[i], app, app_mngr); if (mobile_apis::Result::SUCCESS != res) { LOG4CXX_DEBUG(logger_, "VerifyImageFiles result:" << res); return res; @@ -2187,7 +2210,8 @@ mobile_apis::Result::eType MessageHelper::VerifyImageFiles( key != keys.end(); ++key) { if (strings::soft_buttons != (*key)) { - mobile_apis::Result::eType res = VerifyImageFiles(message[*key], app, app_mngr); + mobile_apis::Result::eType res = + VerifyImageFiles(message[*key], app, app_mngr); if (mobile_apis::Result::SUCCESS != res) { LOG4CXX_DEBUG(logger_, "VerifyImageFiles result:" << res); return res; @@ -2202,7 +2226,8 @@ mobile_apis::Result::eType MessageHelper::VerifyImageFiles( mobile_apis::Result::eType MessageHelper::VerifyImage( smart_objects::SmartObject& image, - ApplicationConstSharedPtr app, ApplicationManager& app_mngr) { + ApplicationConstSharedPtr app, + ApplicationManager& app_mngr) { // Checking image type first: if STATIC - skip existence check, since it is // HMI related file and it should know it location const uint32_t image_type = image[strings::image_type].asUInt(); @@ -2213,7 +2238,7 @@ mobile_apis::Result::eType MessageHelper::VerifyImage( } const std::string& file_name = image[strings::value].asString(); - + std::string str = file_name; str.erase(remove(str.begin(), str.end(), ' '), str.end()); if (0 == str.size()) { @@ -2253,12 +2278,15 @@ mobile_apis::Result::eType MessageHelper::VerifyImage( } mobile_apis::Result::eType MessageHelper::VerifyImageVrHelpItems( - smart_objects::SmartObject& message, ApplicationConstSharedPtr app, ApplicationManager& app_mngr) { + smart_objects::SmartObject& message, + ApplicationConstSharedPtr app, + ApplicationManager& app_mngr) { mobile_apis::Result::eType verification_result_image = mobile_apis::Result::SUCCESS; for (uint32_t i = 0; i < message.length(); ++i) { if (message[i].keyExists(strings::image)) { - verification_result_image = VerifyImage(message[i][strings::image], app, app_mngr); + verification_result_image = + VerifyImage(message[i][strings::image], app, app_mngr); if (mobile_apis::Result::SUCCESS != verification_result_image) { return verification_result_image; } @@ -2291,7 +2319,8 @@ bool CheckWithPolicy(mobile_api::SystemAction::eType system_action, return result; } -mobile_apis::Result::eType MessageHelper::ProcessSoftButtons(smart_objects::SmartObject& message_params, +mobile_apis::Result::eType MessageHelper::ProcessSoftButtons( + smart_objects::SmartObject& message_params, ApplicationConstSharedPtr app, const policy::PolicyHandlerInterface& policy_handler, ApplicationManager& app_mngr) { @@ -2318,7 +2347,8 @@ mobile_apis::Result::eType MessageHelper::ProcessSoftButtons(smart_objects::Smar request_soft_buttons[i][strings::system_action].asInt(); if (!CheckWithPolicy(static_cast<SystemAction::eType>(system_action), - app->policy_app_id(), policy_handler)) { + app->policy_app_id(), + policy_handler)) { return Result::DISALLOWED; } @@ -2331,7 +2361,8 @@ mobile_apis::Result::eType MessageHelper::ProcessSoftButtons(smart_objects::Smar if ((!request_soft_buttons[i].keyExists(strings::image) || (Result::SUCCESS != - VerifyImage(request_soft_buttons[i][strings::image], app, app_mngr)))) { + VerifyImage( + request_soft_buttons[i][strings::image], app, app_mngr)))) { return Result::INVALID_DATA; } break; @@ -2339,7 +2370,7 @@ mobile_apis::Result::eType MessageHelper::ProcessSoftButtons(smart_objects::Smar case SoftButtonType::SBT_TEXT: { if ((!request_soft_buttons[i].keyExists(strings::text)) || (!VerifySoftButtonString( - request_soft_buttons[i][strings::text].asString()))) { + request_soft_buttons[i][strings::text].asString()))) { return Result::INVALID_DATA; } break; @@ -2348,13 +2379,14 @@ mobile_apis::Result::eType MessageHelper::ProcessSoftButtons(smart_objects::Smar if ((!request_soft_buttons[i].keyExists(strings::text)) || ((request_soft_buttons[i][strings::text].length()) && (!VerifySoftButtonString( - request_soft_buttons[i][strings::text].asString())))) { + request_soft_buttons[i][strings::text].asString())))) { return Result::INVALID_DATA; } if ((!request_soft_buttons[i].keyExists(strings::image) || (Result::SUCCESS != - VerifyImage(request_soft_buttons[i][strings::image], app, app_mngr)))) { + VerifyImage( + request_soft_buttons[i][strings::image], app, app_mngr)))) { return Result::INVALID_DATA; } break; diff --git a/src/components/application_manager/src/mobile_command_factory.cc b/src/components/application_manager/src/mobile_command_factory.cc index dd00a80557..e9d169eaf8 100644 --- a/src/components/application_manager/src/mobile_command_factory.cc +++ b/src/components/application_manager/src/mobile_command_factory.cc @@ -142,211 +142,253 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( const commands::MessageSharedPtr& message, commands::Command::CommandOrigin origin, ApplicationManager& application_manager) { - CommandSharedPtr command; + CommandSharedPtr command; switch ((*message)[strings::params][strings::function_id].asInt()) { case mobile_apis::FunctionID::RegisterAppInterfaceID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kRequest)) { - command.reset(new commands::RegisterAppInterfaceRequest(message, application_manager)); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kRequest)) { + command.reset(new commands::RegisterAppInterfaceRequest( + message, application_manager)); } else { - command.reset(new commands::RegisterAppInterfaceResponse(message, application_manager)); + command.reset(new commands::RegisterAppInterfaceResponse( + message, application_manager)); } break; } case mobile_apis::FunctionID::UnregisterAppInterfaceID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kRequest)) { - command.reset(new commands::UnregisterAppInterfaceRequest(message, application_manager)); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kRequest)) { + command.reset(new commands::UnregisterAppInterfaceRequest( + message, application_manager)); } else { - command.reset(new commands::UnregisterAppInterfaceResponse(message, application_manager)); + command.reset(new commands::UnregisterAppInterfaceResponse( + message, application_manager)); } break; } case mobile_apis::FunctionID::SetGlobalPropertiesID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset(new commands::SetGlobalPropertiesResponse(message, application_manager)); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command.reset(new commands::SetGlobalPropertiesResponse( + message, application_manager)); } else { - command.reset(new commands::SetGlobalPropertiesRequest(message, application_manager)); + command.reset(new commands::SetGlobalPropertiesRequest( + message, application_manager)); } break; } case mobile_apis::FunctionID::ResetGlobalPropertiesID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset(new commands::ResetGlobalPropertiesResponse(message, application_manager)); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command.reset(new commands::ResetGlobalPropertiesResponse( + message, application_manager)); } else { - command.reset(new commands::ResetGlobalPropertiesRequest(message, application_manager)); + command.reset(new commands::ResetGlobalPropertiesRequest( + message, application_manager)); } break; } case mobile_apis::FunctionID::AddCommandID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset(new commands::AddCommandResponse(message, application_manager)); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command.reset( + new commands::AddCommandResponse(message, application_manager)); } else { - command.reset(new commands::AddCommandRequest(message, application_manager)); + command.reset( + new commands::AddCommandRequest(message, application_manager)); } break; } case mobile_apis::FunctionID::DeleteCommandID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset(new commands::DeleteCommandResponse(message, application_manager)); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command.reset( + new commands::DeleteCommandResponse(message, application_manager)); } else { - command.reset(new commands::DeleteCommandRequest(message, application_manager)); + command.reset( + new commands::DeleteCommandRequest(message, application_manager)); } break; } case mobile_apis::FunctionID::AddSubMenuID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset(new commands::AddSubMenuResponse(message, application_manager)); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command.reset( + new commands::AddSubMenuResponse(message, application_manager)); } else { - command.reset(new commands::AddSubMenuRequest(message, application_manager)); + command.reset( + new commands::AddSubMenuRequest(message, application_manager)); } break; } case mobile_apis::FunctionID::DeleteSubMenuID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset(new commands::DeleteSubMenuResponse(message, application_manager)); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command.reset( + new commands::DeleteSubMenuResponse(message, application_manager)); } else { - command.reset(new commands::DeleteSubMenuRequest(message, application_manager)); + command.reset( + new commands::DeleteSubMenuRequest(message, application_manager)); } break; } case mobile_apis::FunctionID::DeleteInteractionChoiceSetID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset(new commands::DeleteInteractionChoiceSetResponse(message, application_manager)); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command.reset(new commands::DeleteInteractionChoiceSetResponse( + message, application_manager)); } else { - command.reset(new commands::DeleteInteractionChoiceSetRequest(message, application_manager)); + command.reset(new commands::DeleteInteractionChoiceSetRequest( + message, application_manager)); } break; } case mobile_apis::FunctionID::AlertID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset(new commands::AlertResponse(message, application_manager)); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command.reset( + new commands::AlertResponse(message, application_manager)); } else { command.reset(new commands::AlertRequest(message, application_manager)); } break; } case mobile_apis::FunctionID::SpeakID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset(new commands::SpeakResponse(message, application_manager)); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command.reset( + new commands::SpeakResponse(message, application_manager)); } else { command.reset(new commands::SpeakRequest(message, application_manager)); } break; } case mobile_apis::FunctionID::SliderID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset(new commands::SliderResponse(message, application_manager)); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command.reset( + new commands::SliderResponse(message, application_manager)); } else { - command.reset(new commands::SliderRequest(message, application_manager)); + command.reset( + new commands::SliderRequest(message, application_manager)); } break; } case mobile_apis::FunctionID::PerformAudioPassThruID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset(new commands::PerformAudioPassThruResponse(message, application_manager)); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command.reset(new commands::PerformAudioPassThruResponse( + message, application_manager)); } else { - command.reset(new commands::PerformAudioPassThruRequest(message, application_manager)); + command.reset(new commands::PerformAudioPassThruRequest( + message, application_manager)); } break; } case mobile_apis::FunctionID::CreateInteractionChoiceSetID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset(new commands::CreateInteractionChoiceSetResponse(message, application_manager)); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command.reset(new commands::CreateInteractionChoiceSetResponse( + message, application_manager)); } else { - command.reset(new commands::CreateInteractionChoiceSetRequest(message, application_manager)); + command.reset(new commands::CreateInteractionChoiceSetRequest( + message, application_manager)); } break; } case mobile_apis::FunctionID::PerformInteractionID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset(new commands::PerformInteractionResponse(message, application_manager)); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command.reset(new commands::PerformInteractionResponse( + message, application_manager)); } else { - command.reset(new commands::PerformInteractionRequest(message, application_manager)); + command.reset(new commands::PerformInteractionRequest( + message, application_manager)); } break; } case mobile_apis::FunctionID::EndAudioPassThruID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset(new commands::EndAudioPassThruResponse(message, application_manager)); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command.reset(new commands::EndAudioPassThruResponse( + message, application_manager)); } else { - command.reset(new commands::EndAudioPassThruRequest(message, application_manager)); + command.reset(new commands::EndAudioPassThruRequest( + message, application_manager)); } break; } case mobile_apis::FunctionID::PutFileID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset(new commands::PutFileResponse(message, application_manager)); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command.reset( + new commands::PutFileResponse(message, application_manager)); } else { - command.reset(new commands::PutFileRequest(message, application_manager)); + command.reset( + new commands::PutFileRequest(message, application_manager)); } break; } case mobile_apis::FunctionID::DeleteFileID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset(new commands::DeleteFileResponse(message, application_manager)); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command.reset( + new commands::DeleteFileResponse(message, application_manager)); } else { - command.reset(new commands::DeleteFileRequest(message, application_manager)); + command.reset( + new commands::DeleteFileRequest(message, application_manager)); } break; } case mobile_apis::FunctionID::ListFilesID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset(new commands::ListFilesResponse(message, application_manager)); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command.reset( + new commands::ListFilesResponse(message, application_manager)); } else { - command.reset(new commands::ListFilesRequest(message, application_manager)); + command.reset( + new commands::ListFilesRequest(message, application_manager)); } break; } case mobile_apis::FunctionID::SubscribeButtonID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset(new commands::SubscribeButtonResponse(message, application_manager)); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command.reset(new commands::SubscribeButtonResponse( + message, application_manager)); } else { - command.reset(new commands::SubscribeButtonRequest(message, application_manager)); + command.reset( + new commands::SubscribeButtonRequest(message, application_manager)); } break; } case mobile_apis::FunctionID::UnsubscribeButtonID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset(new commands::UnsubscribeButtonResponse(message, application_manager)); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command.reset(new commands::UnsubscribeButtonResponse( + message, application_manager)); } else { - command.reset(new commands::UnsubscribeButtonRequest(message, application_manager)); + command.reset(new commands::UnsubscribeButtonRequest( + message, application_manager)); } break; } case mobile_apis::FunctionID::ShowConstantTBTID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset(new commands::ShowConstantTBTResponse(message, application_manager)); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command.reset(new commands::ShowConstantTBTResponse( + message, application_manager)); } else { - command.reset(new commands::ShowConstantTBTRequest(message, application_manager)); + command.reset( + new commands::ShowConstantTBTRequest(message, application_manager)); } break; } case mobile_apis::FunctionID::ShowID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { command.reset(new commands::ShowResponse(message, application_manager)); } else { command.reset(new commands::ShowRequest(message, application_manager)); @@ -354,246 +396,301 @@ CommandSharedPtr MobileCommandFactory::CreateCommand( break; } case mobile_apis::FunctionID::GetWayPointsID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command = utils::MakeShared<commands::GetWayPointsResponse>(message, application_manager); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command = utils::MakeShared<commands::GetWayPointsResponse>( + message, application_manager); } else { - command = utils::MakeShared<commands::GetWayPointsRequest>(message, application_manager); + command = utils::MakeShared<commands::GetWayPointsRequest>( + message, application_manager); } break; } case mobile_apis::FunctionID::SubscribeVehicleDataID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset(new commands::SubscribeVehicleDataResponse(message, application_manager)); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command.reset(new commands::SubscribeVehicleDataResponse( + message, application_manager)); } else { - command.reset(new commands::SubscribeVehicleDataRequest(message, application_manager)); + command.reset(new commands::SubscribeVehicleDataRequest( + message, application_manager)); } break; } case mobile_apis::FunctionID::UnsubscribeVehicleDataID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset(new commands::UnsubscribeVehicleDataResponse(message, application_manager)); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command.reset(new commands::UnsubscribeVehicleDataResponse( + message, application_manager)); } else { - command.reset(new commands::UnsubscribeVehicleDataRequest(message, application_manager)); + command.reset(new commands::UnsubscribeVehicleDataRequest( + message, application_manager)); } break; } case mobile_apis::FunctionID::SubscribeWayPointsID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command = utils::MakeShared<commands::SubscribeWayPointsResponse>(message, application_manager); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command = utils::MakeShared<commands::SubscribeWayPointsResponse>( + message, application_manager); } else { - command = utils::MakeShared<commands::SubscribeWayPointsRequest>(message, application_manager); + command = utils::MakeShared<commands::SubscribeWayPointsRequest>( + message, application_manager); } break; } case mobile_apis::FunctionID::UnsubscribeWayPointsID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command = utils::MakeShared<commands::UnsubscribeWayPointsResponse>(message, application_manager); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command = utils::MakeShared<commands::UnsubscribeWayPointsResponse>( + message, application_manager); } else { - command = utils::MakeShared<commands::UnSubscribeWayPointsRequest>(message, application_manager); + command = utils::MakeShared<commands::UnSubscribeWayPointsRequest>( + message, application_manager); } break; } case mobile_apis::FunctionID::ReadDIDID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset(new commands::ReadDIDResponse(message, application_manager)); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command.reset( + new commands::ReadDIDResponse(message, application_manager)); } else { - command.reset(new commands::ReadDIDRequest(message, application_manager)); + command.reset( + new commands::ReadDIDRequest(message, application_manager)); } break; } case mobile_apis::FunctionID::GetVehicleDataID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset(new commands::GetVehicleDataResponse(message, application_manager)); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command.reset( + new commands::GetVehicleDataResponse(message, application_manager)); } else { - command.reset(new commands::GetVehicleDataRequest(message, application_manager)); + command.reset( + new commands::GetVehicleDataRequest(message, application_manager)); } break; } case mobile_apis::FunctionID::ScrollableMessageID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset(new commands::ScrollableMessageResponse(message, application_manager)); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command.reset(new commands::ScrollableMessageResponse( + message, application_manager)); } else { - command.reset(new commands::ScrollableMessageRequest(message, application_manager)); + command.reset(new commands::ScrollableMessageRequest( + message, application_manager)); } break; } case mobile_apis::FunctionID::AlertManeuverID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset(new commands::AlertManeuverResponse(message, application_manager)); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command.reset( + new commands::AlertManeuverResponse(message, application_manager)); } else { - command.reset(new commands::AlertManeuverRequest(message, application_manager)); + command.reset( + new commands::AlertManeuverRequest(message, application_manager)); } break; } case mobile_apis::FunctionID::SetAppIconID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset(new commands::SetAppIconResponse(message, application_manager)); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command.reset( + new commands::SetAppIconResponse(message, application_manager)); } else { - command.reset(new commands::SetAppIconRequest(message, application_manager)); + command.reset( + new commands::SetAppIconRequest(message, application_manager)); } break; } case mobile_apis::FunctionID::SetDisplayLayoutID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset(new commands::SetDisplayLayoutResponse(message, application_manager)); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command.reset(new commands::SetDisplayLayoutResponse( + message, application_manager)); } else { - command.reset(new commands::SetDisplayLayoutRequest(message, application_manager)); + command.reset(new commands::SetDisplayLayoutRequest( + message, application_manager)); } break; } case mobile_apis::FunctionID::UpdateTurnListID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset(new commands::UpdateTurnListResponse(message, application_manager)); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command.reset( + new commands::UpdateTurnListResponse(message, application_manager)); } else { - command.reset(new commands::UpdateTurnListRequest(message, application_manager)); + command.reset( + new commands::UpdateTurnListRequest(message, application_manager)); } break; } case mobile_apis::FunctionID::ChangeRegistrationID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset(new commands::ChangeRegistrationResponse(message, application_manager)); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command.reset(new commands::ChangeRegistrationResponse( + message, application_manager)); } else { - command.reset(new commands::ChangeRegistrationRequest(message, application_manager)); + command.reset(new commands::ChangeRegistrationRequest( + message, application_manager)); } break; } case mobile_apis::FunctionID::GetDTCsID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset(new commands::GetDTCsResponse(message, application_manager)); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command.reset( + new commands::GetDTCsResponse(message, application_manager)); } else { - command.reset(new commands::GetDTCsRequest(message, application_manager)); + command.reset( + new commands::GetDTCsRequest(message, application_manager)); } break; } case mobile_apis::FunctionID::DiagnosticMessageID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset(new commands::DiagnosticMessageResponse(message, application_manager)); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command.reset(new commands::DiagnosticMessageResponse( + message, application_manager)); } else { - command.reset(new commands::DiagnosticMessageRequest(message, application_manager)); + command.reset(new commands::DiagnosticMessageRequest( + message, application_manager)); } break; } case mobile_apis::FunctionID::SetMediaClockTimerID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset(new commands::SetMediaClockTimerResponse(message, application_manager)); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command.reset(new commands::SetMediaClockTimerResponse( + message, application_manager)); } else { - command.reset(new commands::SetMediaClockRequest(message, application_manager)); + command.reset( + new commands::SetMediaClockRequest(message, application_manager)); } break; } case mobile_apis::FunctionID::SystemRequestID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset(new commands::SystemResponse(message, application_manager)); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command.reset( + new commands::SystemResponse(message, application_manager)); } else { - command.reset(new commands::SystemRequest(message, application_manager)); + command.reset( + new commands::SystemRequest(message, application_manager)); } break; } case mobile_apis::FunctionID::SendLocationID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset(new commands::SendLocationResponse(message, application_manager)); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command.reset( + new commands::SendLocationResponse(message, application_manager)); } else { - command.reset(new commands::SendLocationRequest(message, application_manager)); + command.reset( + new commands::SendLocationRequest(message, application_manager)); } break; } case mobile_apis::FunctionID::DialNumberID: { - if ((*message)[strings::params][strings::message_type] - == static_cast<int>(application_manager::MessageType::kResponse)) { - command.reset(new commands::DialNumberResponse(message, application_manager)); + if ((*message)[strings::params][strings::message_type] == + static_cast<int>(application_manager::MessageType::kResponse)) { + command.reset( + new commands::DialNumberResponse(message, application_manager)); } else { - command.reset(new commands::DialNumberRequest(message, application_manager)); + command.reset( + new commands::DialNumberRequest(message, application_manager)); } break; } case mobile_apis::FunctionID::OnButtonEventID: { - command.reset(new commands::mobile::OnButtonEventNotification(message, application_manager)); + command.reset(new commands::mobile::OnButtonEventNotification( + message, application_manager)); break; } case mobile_apis::FunctionID::OnButtonPressID: { - command.reset(new commands::mobile::OnButtonPressNotification(message, application_manager)); + command.reset(new commands::mobile::OnButtonPressNotification( + message, application_manager)); break; } case mobile_apis::FunctionID::OnAudioPassThruID: { - command.reset(new commands::OnAudioPassThruNotification(message, application_manager)); + command.reset(new commands::OnAudioPassThruNotification( + message, application_manager)); break; } case mobile_apis::FunctionID::OnVehicleDataID: { - command.reset(new commands::OnVehicleDataNotification(message, application_manager)); + command.reset(new commands::OnVehicleDataNotification( + message, application_manager)); break; } case mobile_apis::FunctionID::OnAppInterfaceUnregisteredID: { - command.reset(new commands::OnAppInterfaceUnregisteredNotification(message, application_manager)); + command.reset(new commands::OnAppInterfaceUnregisteredNotification( + message, application_manager)); break; } case mobile_apis::FunctionID::OnCommandID: { - command.reset(new commands::OnCommandNotification(message, application_manager)); + command.reset( + new commands::OnCommandNotification(message, application_manager)); break; } case mobile_apis::FunctionID::OnTBTClientStateID: { - command.reset(new commands::OnTBTClientStateNotification(message, application_manager)); + command.reset(new commands::OnTBTClientStateNotification( + message, application_manager)); break; } case mobile_apis::FunctionID::OnDriverDistractionID: { - command.reset(new commands::mobile::OnDriverDistractionNotification(message, application_manager)); + command.reset(new commands::mobile::OnDriverDistractionNotification( + message, application_manager)); break; } case mobile_apis::FunctionID::OnLanguageChangeID: { - command.reset(new commands::OnLanguageChangeNotification(message, application_manager)); + command.reset(new commands::OnLanguageChangeNotification( + message, application_manager)); break; } case mobile_apis::FunctionID::OnPermissionsChangeID: { - command.reset(new commands::OnPermissionsChangeNotification(message, application_manager)); + command.reset(new commands::OnPermissionsChangeNotification( + message, application_manager)); break; } case mobile_apis::FunctionID::OnHMIStatusID: { if (commands::Command::ORIGIN_SDL == origin) { - command.reset(new commands::OnHMIStatusNotification(message, application_manager)); + command.reset(new commands::OnHMIStatusNotification( + message, application_manager)); } break; } case mobile_apis::FunctionID::OnKeyboardInputID: { - command.reset(new commands::mobile::OnKeyBoardInputNotification(message, application_manager)); + command.reset(new commands::mobile::OnKeyBoardInputNotification( + message, application_manager)); break; } case mobile_apis::FunctionID::OnTouchEventID: { - command.reset(new commands::mobile::OnTouchEventNotification(message, application_manager)); + command.reset(new commands::mobile::OnTouchEventNotification( + message, application_manager)); break; } case mobile_apis::FunctionID::OnSystemRequestID: { - command.reset(new commands::mobile::OnSystemRequestNotification(message, application_manager)); + command.reset(new commands::mobile::OnSystemRequestNotification( + message, application_manager)); break; } case mobile_apis::FunctionID::OnHashChangeID: { - command.reset(new commands::mobile::OnHashChangeNotification(message, application_manager)); + command.reset(new commands::mobile::OnHashChangeNotification( + message, application_manager)); break; } case mobile_apis::FunctionID::OnWayPointChangeID: { - command = utils::MakeShared<commands::OnWayPointChangeNotification>(message, application_manager); + command = utils::MakeShared<commands::OnWayPointChangeNotification>( + message, application_manager); break; } default: { (*message)[strings::params][strings::function_id] = static_cast<int32_t>(mobile_apis::FunctionID::GenericResponseID); - command.reset(new commands::GenericResponse(message, application_manager)); + command.reset( + new commands::GenericResponse(message, application_manager)); } } return command; diff --git a/src/components/application_manager/src/policies/delegates/app_permission_delegate.cc b/src/components/application_manager/src/policies/delegates/app_permission_delegate.cc index fa242962d4..7b5954a3c3 100644 --- a/src/components/application_manager/src/policies/delegates/app_permission_delegate.cc +++ b/src/components/application_manager/src/policies/delegates/app_permission_delegate.cc @@ -34,20 +34,19 @@ #include "application_manager/application_manager.h" namespace policy { - CREATE_LOGGERPTR_GLOBAL(logger_, "PolicyHandler") +CREATE_LOGGERPTR_GLOBAL(logger_, "PolicyHandler") - AppPermissionDelegate::AppPermissionDelegate( - const uint32_t connection_key, - const PermissionConsent& permissions, - policy::PolicyHandlerInterface& policy_handler) - : connection_key_(connection_key) - , permissions_(permissions) - , policy_handler_(policy_handler) {} +AppPermissionDelegate::AppPermissionDelegate( + const uint32_t connection_key, + const PermissionConsent& permissions, + policy::PolicyHandlerInterface& policy_handler) + : connection_key_(connection_key) + , permissions_(permissions) + , policy_handler_(policy_handler) {} - void AppPermissionDelegate::threadMain() { +void AppPermissionDelegate::threadMain() { LOG4CXX_AUTO_TRACE(logger_); - policy_handler_.OnAppPermissionConsentInternal(connection_key_, - permissions_); + policy_handler_.OnAppPermissionConsentInternal(connection_key_, permissions_); } void AppPermissionDelegate::exitThreadMain() { 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 819d99e065..492abe499a 100644 --- a/src/components/application_manager/src/policies/policy_event_observer.cc +++ b/src/components/application_manager/src/policies/policy_event_observer.cc @@ -48,7 +48,8 @@ PolicyEventObserver::PolicyEventObserver( application_manager::event_engine::EventDispatcher& event_dispatcher) : EventObserver(event_dispatcher), policy_handler_(policy_handler) {} -void PolicyEventObserver::set_policy_handler(PolicyHandlerInterface* const policy_handler) { +void PolicyEventObserver::set_policy_handler( + PolicyHandlerInterface* const policy_handler) { LOG4CXX_AUTO_TRACE(logger_); sync_primitives::AutoLock auto_lock(policy_handler_lock_); LOG4CXX_DEBUG(logger_, "Set policy handler " << policy_handler); @@ -68,10 +69,8 @@ void PolicyEventObserver::on_event(const event_engine::Event& event) { ProcessOdometerEvent(message); break; } - default: { - break; - } - unsubscribe_from_event(hmi_apis::FunctionID::VehicleInfo_GetOdometer); + default: { break; } + unsubscribe_from_event(hmi_apis::FunctionID::VehicleInfo_GetOdometer); #else case hmi_apis::FunctionID::VehicleInfo_GetVehicleData: { ProcessOdometerEvent(message); @@ -83,23 +82,21 @@ void PolicyEventObserver::on_event(const event_engine::Event& event) { unsubscribe_from_event(hmi_apis::FunctionID::BasicCommunication_OnReady); break; } - default: { - break; - } + default: { break; } #endif } } -void PolicyEventObserver::ProcessOdometerEvent(const smart_objects::SmartObject& message) { - if (hmi_apis::Common_Result::SUCCESS - == static_cast<hmi_apis::Common_Result::eType>(message[strings::params][hmi_response::code] - .asInt())) { - +void PolicyEventObserver::ProcessOdometerEvent( + const smart_objects::SmartObject& message) { + if (hmi_apis::Common_Result::SUCCESS == + static_cast<hmi_apis::Common_Result::eType>( + message[strings::params][hmi_response::code].asInt())) { if (message[strings::msg_params].keyExists(strings::odometer)) { if (policy_handler_) { policy_handler_->PTUpdatedAt( - Counters::KILOMETERS, - message[strings::msg_params][strings::odometer].asInt()); + Counters::KILOMETERS, + message[strings::msg_params][strings::odometer].asInt()); } } } diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index 1961369d9b..c00c51dcfe 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -156,16 +156,15 @@ typedef std::set<application_manager::ApplicationSharedPtr, struct DeactivateApplication { explicit DeactivateApplication( const connection_handler::DeviceHandle& device_id, - StateController& state_ctrl) + StateController& state_ctrl) : device_id_(device_id), state_ctrl_(state_ctrl) {} void operator()(const ApplicationSharedPtr& app) { if (device_id_ == app->device()) { - state_ctrl_.SetRegularState( - app, - mobile_apis::HMILevel::HMI_NONE, - mobile_apis::AudioStreamingState::NOT_AUDIBLE, - true); + state_ctrl_.SetRegularState(app, + mobile_apis::HMILevel::HMI_NONE, + mobile_apis::AudioStreamingState::NOT_AUDIBLE, + true); } } @@ -176,8 +175,8 @@ struct DeactivateApplication { struct SDLAllowedNotification { SDLAllowedNotification(const connection_handler::DeviceHandle& device_id, - PolicyManager* policy_manager, - StateController& state_controller) + PolicyManager* policy_manager, + StateController& state_controller) : device_id_(device_id) , policy_manager_(policy_manager) , state_controller_(state_controller) {} @@ -214,9 +213,9 @@ struct SDLAllowedNotification { struct LinkAppToDevice { explicit LinkAppToDevice( std::map<std::string, std::string>& app_to_device_link, - const ApplicationManager& application_manager) - : app_to_device_link_(app_to_device_link), - application_manager_(application_manager) { + const ApplicationManager& application_manager) + : app_to_device_link_(app_to_device_link) + , application_manager_(application_manager) { app_to_device_link_.clear(); } @@ -227,10 +226,9 @@ struct LinkAppToDevice { "Skip current application."); return; } - DeviceParams device_params = - GetDeviceParams(app->device(), - application_manager_.connection_handler() - .get_session_observer()); + DeviceParams device_params = GetDeviceParams( + app->device(), + application_manager_.connection_handler().get_session_observer()); const std::string app_id = app->policy_app_id(); if (device_params.device_mac_address.empty()) { LOG4CXX_WARN(logger_, @@ -314,9 +312,9 @@ bool PolicyHandler::LoadPolicyLibrary() { if (!error) { if (CreateManager()) { policy_manager_->set_listener(this); - event_observer_ = utils::SharedPtr<PolicyEventObserver>( - new PolicyEventObserver(this, - application_manager_.event_dispatcher())); + event_observer_ = + utils::SharedPtr<PolicyEventObserver>(new PolicyEventObserver( + this, application_manager_.event_dispatcher())); } } else { LOG4CXX_ERROR(logger_, error); @@ -325,20 +323,21 @@ bool PolicyHandler::LoadPolicyLibrary() { return policy_manager_.valid(); } -bool PolicyHandler::PolicyEnabled() const{ +bool PolicyHandler::PolicyEnabled() const { return get_settings().enable_policy(); } bool PolicyHandler::CreateManager() { typedef PolicyManager* (*CreateManager)(); - typedef void (*DeleteManager)(PolicyManager* ); + typedef void (*DeleteManager)(PolicyManager*); CreateManager create_manager = reinterpret_cast<CreateManager>(dlsym(dl_handle_, "CreateManager")); DeleteManager delete_manager = - reinterpret_cast<DeleteManager>(dlsym(dl_handle_, "DeleteManager")); + reinterpret_cast<DeleteManager>(dlsym(dl_handle_, "DeleteManager")); char* error_string = dlerror(); if (NULL == error_string) { - policy_manager_ = utils::SharedPtr<PolicyManager>(create_manager(), delete_manager); + policy_manager_ = + utils::SharedPtr<PolicyManager>(create_manager(), delete_manager); } else { LOG4CXX_WARN(logger_, error_string); } @@ -350,8 +349,8 @@ const PolicySettings& PolicyHandler::get_settings() const { } bool PolicyHandler::InitPolicyTable() { - LOG4CXX_AUTO_TRACE(logger_); - POLICY_LIB_CHECK(false); + LOG4CXX_AUTO_TRACE(logger_); + POLICY_LIB_CHECK(false); // Subscribing to notification for system readiness to be able to get system // info necessary for policy table event_observer_->subscribe_on_event( @@ -367,7 +366,7 @@ bool PolicyHandler::InitPolicyTable() { bool PolicyHandler::ResetPolicyTable() { LOG4CXX_TRACE(logger_, "Reset policy table."); POLICY_LIB_CHECK(false); - const std::string& preloaded_file =get_settings().preloaded_pt_file(); + const std::string& preloaded_file = get_settings().preloaded_pt_file(); if (file_system::FileExists(preloaded_file)) { return policy_manager_->ResetPT(preloaded_file); } @@ -383,7 +382,8 @@ bool PolicyHandler::ClearUserConsent() { uint32_t PolicyHandler::GetAppIdForSending() const { POLICY_LIB_CHECK(0); - const ApplicationSet& accessor = application_manager_.applications().GetData(); + const ApplicationSet& accessor = + application_manager_.applications().GetData(); HmiLevelOrderedApplicationList app_list(accessor.begin(), accessor.end()); LOG4CXX_INFO(logger_, "Apps size: " << app_list.size()); @@ -392,11 +392,10 @@ uint32_t PolicyHandler::GetAppIdForSending() const { first != app_list.end(); ++first) { if ((*first)->IsRegistered()) { - const uint32_t app_id = (*first)->app_id(); - DeviceParams device_params = - GetDeviceParams((*first)->device(), - application_manager_.connection_handler() - .get_session_observer()); + const uint32_t app_id = (*first)->app_id(); + DeviceParams device_params = GetDeviceParams( + (*first)->device(), + application_manager_.connection_handler().get_session_observer()); if (kDeviceAllowed == policy_manager_->GetUserConsentForDevice( @@ -418,14 +417,15 @@ void PolicyHandler::OnDeviceConsentChanged(const std::string& device_id, const bool is_allowed) { POLICY_LIB_CHECK_VOID(); connection_handler::DeviceHandle device_handle; - application_manager_.connection_handler().GetDeviceID( - device_id, &device_handle); + application_manager_.connection_handler().GetDeviceID(device_id, + &device_handle); // In case of changed consent for device, related applications will be // limited to pre_DataConsent permissions, if device disallowed, or switch // back to their own permissions, if device allowed again, and must be // notified about these changes - const ApplicationSet& accessor = application_manager_.applications().GetData(); + const ApplicationSet& accessor = + application_manager_.applications().GetData(); ApplicationSetConstIt it_app_list = accessor.begin(); ApplicationSetConstIt it_app_list_end = accessor.end(); for (; it_app_list != it_app_list_end; ++it_app_list) { @@ -453,24 +453,25 @@ void PolicyHandler::SendOnAppPermissionsChanged( "PolicyHandler::SendOnAppPermissionsChanged for " << policy_app_id); ApplicationSharedPtr app = - application_manager_.application_by_policy_id( - policy_app_id); + application_manager_.application_by_policy_id(policy_app_id); if (!app.valid()) { LOG4CXX_WARN(logger_, "No app found for policy app id = " << policy_app_id); return; } - MessageHelper::SendOnAppPermissionsChangedNotification(app->app_id(), - permissions, application_manager_); + MessageHelper::SendOnAppPermissionsChangedNotification( + app->app_id(), permissions, application_manager_); } void PolicyHandler::OnPTExchangeNeeded() { POLICY_LIB_CHECK_VOID(); - MessageHelper::SendOnStatusUpdate(policy_manager_->ForcePTExchange(), application_manager_); + MessageHelper::SendOnStatusUpdate(policy_manager_->ForcePTExchange(), + application_manager_); } void PolicyHandler::GetAvailableApps(std::queue<std::string>& apps) { LOG4CXX_INFO(logger_, "GetAvailable apps"); - const ApplicationSet& app_list = application_manager_.applications().GetData(); + const ApplicationSet& app_list = + application_manager_.applications().GetData(); ApplicationSetConstIt iter = app_list.begin(); for (; app_list.end() != iter; ++iter) { @@ -503,15 +504,13 @@ void PolicyHandler::OnAppPermissionConsentInternal( LOG4CXX_AUTO_TRACE(logger_); POLICY_LIB_CHECK_VOID(); if (connection_key) { - ApplicationSharedPtr app = - application_manager_.application(connection_key); + ApplicationSharedPtr app = application_manager_.application(connection_key); if (app.valid()) { permissions.policy_app_id = app->policy_app_id(); - DeviceParams device_params = - GetDeviceParams(app->device(), - application_manager_.connection_handler() - .get_session_observer()); + DeviceParams device_params = GetDeviceParams( + app->device(), + application_manager_.connection_handler().get_session_observer()); permissions.device_id = device_params.device_mac_address; } @@ -548,10 +547,9 @@ void PolicyHandler::OnAppPermissionConsentInternal( continue; } - DeviceParams device_params = - GetDeviceParams(app->device(), - application_manager_.connection_handler() - .get_session_observer()); + DeviceParams device_params = GetDeviceParams( + app->device(), + application_manager_.connection_handler().get_session_observer()); if (device_params.device_mac_address != it->second) { LOG4CXX_WARN(logger_, @@ -590,7 +588,8 @@ void PolicyHandler::OnGetUserFriendlyMessage( std::vector<UserFriendlyMessage> result = policy_manager_->GetUserFriendlyMessages(message_codes, language); // Send response to HMI with gathered data - MessageHelper::SendGetUserFriendlyMessageResponse(result, correlation_id, application_manager_); + MessageHelper::SendGetUserFriendlyMessageResponse( + result, correlation_id, application_manager_); } void PolicyHandler::OnGetListOfPermissions(const uint32_t connection_key, @@ -602,7 +601,8 @@ void PolicyHandler::OnGetListOfPermissions(const uint32_t connection_key, if (!connection_key) { sync_primitives::AutoLock lock(app_to_device_link_lock_); LinkAppToDevice linker(app_to_device_link_, application_manager_); - const ApplicationSet& accessor = application_manager_.applications().GetData(); + const ApplicationSet& accessor = + application_manager_.applications().GetData(); ApplicationSetConstIt it_app = accessor.begin(); ApplicationSetConstIt it_app_end = accessor.end(); @@ -620,7 +620,9 @@ void PolicyHandler::OnGetListOfPermissions(const uint32_t connection_key, } MessageHelper::SendGetListOfPermissionsResponse( - consolidator.GetConsolidatedPermissions(), correlation_id, application_manager_); + consolidator.GetConsolidatedPermissions(), + correlation_id, + application_manager_); return; } @@ -637,10 +639,9 @@ void PolicyHandler::OnGetListOfPermissions(const uint32_t connection_key, return; } - DeviceParams device_params = - GetDeviceParams(app->device(), - application_manager_.connection_handler() - .get_session_observer()); + DeviceParams device_params = GetDeviceParams( + app->device(), + application_manager_.connection_handler().get_session_observer()); std::vector<FunctionalGroupPermission> group_permissions; if (device_params.device_mac_address.empty()) { @@ -652,8 +653,8 @@ void PolicyHandler::OnGetListOfPermissions(const uint32_t connection_key, app->policy_app_id(), group_permissions); - MessageHelper::SendGetListOfPermissionsResponse(group_permissions, - correlation_id, application_manager_); + MessageHelper::SendGetListOfPermissionsResponse( + group_permissions, correlation_id, application_manager_); } } @@ -661,7 +662,9 @@ void PolicyHandler::OnGetStatusUpdate(const uint32_t correlation_id) { LOG4CXX_AUTO_TRACE(logger_); POLICY_LIB_CHECK_VOID(); MessageHelper::SendGetStatusUpdateResponse( - policy_manager_->GetPolicyTableStatus(), correlation_id, application_manager_); + policy_manager_->GetPolicyTableStatus(), + correlation_id, + application_manager_); } void PolicyHandler::OnUpdateStatusChanged(const std::string& status) { @@ -673,8 +676,7 @@ std::string PolicyHandler::OnCurrentDeviceIdUpdateRequired( const std::string& policy_app_id) { LOG4CXX_AUTO_TRACE(logger_); ApplicationSharedPtr app = - application_manager_.application_by_policy_id( - policy_app_id); + application_manager_.application_by_policy_id(policy_app_id); if (!app.valid()) { LOG4CXX_WARN(logger_, @@ -684,10 +686,9 @@ std::string PolicyHandler::OnCurrentDeviceIdUpdateRequired( "not found within registered applications."); return ""; } - DeviceParams device_params = - GetDeviceParams(app->device(), - application_manager_.connection_handler() - .get_session_observer()); + DeviceParams device_params = GetDeviceParams( + app->device(), + application_manager_.connection_handler().get_session_observer()); return device_params.device_mac_address; } @@ -714,12 +715,14 @@ void PolicyHandler::OnSystemInfoUpdateRequired() { void PolicyHandler::OnVIIsReady() { LOG4CXX_AUTO_TRACE(logger_); - const uint32_t correlation_id = application_manager_.GetNextHMICorrelationID(); + const uint32_t correlation_id = + application_manager_.GetNextHMICorrelationID(); std::vector<std::string> params; params.push_back(strings::vin); - MessageHelper::CreateGetVehicleDataRequest(correlation_id, params, application_manager_); + MessageHelper::CreateGetVehicleDataRequest( + correlation_id, params, application_manager_); } void PolicyHandler::OnVehicleDataUpdated( @@ -733,8 +736,8 @@ void PolicyHandler::OnPendingPermissionChange( "PolicyHandler::OnPendingPermissionChange for " << policy_app_id); POLICY_LIB_CHECK_VOID(); - ApplicationSharedPtr app = application_manager_.application_by_policy_id( - policy_app_id); + ApplicationSharedPtr app = + application_manager_.application_by_policy_id(policy_app_id); if (!app.valid()) { LOG4CXX_WARN(logger_, "No app found for " << policy_app_id << " policy app id."); @@ -764,8 +767,8 @@ void PolicyHandler::OnPendingPermissionChange( case mobile_apis::HMILevel::eType::HMI_FULL: case mobile_apis::HMILevel::eType::HMI_LIMITED: { if (permissions.appPermissionsConsentNeeded) { - MessageHelper::SendOnAppPermissionsChangedNotification(app->app_id(), - permissions, application_manager_); + MessageHelper::SendOnAppPermissionsChangedNotification( + app->app_id(), permissions, application_manager_); policy_manager_->RemovePendingPermissionChanges(policy_app_id); // "Break" statement has to be here to continue processing in case of @@ -775,8 +778,8 @@ void PolicyHandler::OnPendingPermissionChange( } case mobile_apis::HMILevel::eType::HMI_BACKGROUND: { if (permissions.isAppPermissionsRevoked) { - MessageHelper::SendOnAppPermissionsChangedNotification(app->app_id(), - permissions, application_manager_); + MessageHelper::SendOnAppPermissionsChangedNotification( + app->app_id(), permissions, application_manager_); policy_manager_->RemovePendingPermissionChanges(policy_app_id); } @@ -789,12 +792,14 @@ void PolicyHandler::OnPendingPermissionChange( if (permissions.appUnauthorized) { if (mobile_apis::HMILevel::HMI_FULL == app_hmi_level || mobile_apis::HMILevel::HMI_LIMITED == app_hmi_level) { - MessageHelper::SendOnAppPermissionsChangedNotification(app->app_id(), - permissions, application_manager_); + MessageHelper::SendOnAppPermissionsChangedNotification( + app->app_id(), permissions, application_manager_); } - application_manager_.ManageMobileCommand(MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( - app->app_id(), - mobile_api::AppInterfaceUnregisteredReason::APP_UNAUTHORIZED), commands::Command::ORIGIN_SDL); + application_manager_.ManageMobileCommand( + MessageHelper::GetOnAppInterfaceUnregisteredNotificationToMobile( + app->app_id(), + mobile_api::AppInterfaceUnregisteredReason::APP_UNAUTHORIZED), + commands::Command::ORIGIN_SDL); application_manager_.OnAppUnauthorized(app->app_id()); @@ -802,8 +807,8 @@ void PolicyHandler::OnPendingPermissionChange( } if (permissions.requestTypeChanged) { - MessageHelper::SendOnAppPermissionsChangedNotification(app->app_id(), - permissions, application_manager_); + MessageHelper::SendOnAppPermissionsChangedNotification( + app->app_id(), permissions, application_manager_); policy_manager_->RemovePendingPermissionChanges(policy_app_id); } } @@ -842,7 +847,8 @@ bool PolicyHandler::SendMessageToSDK(const BinaryMessage& pt_string, "Update url is " << url << " for application " "with connection key " << app_id); - MessageHelper::SendPolicySnapshotNotification(app_id, pt_string, url, application_manager_); + MessageHelper::SendPolicySnapshotNotification( + app_id, pt_string, url, application_manager_); return true; } @@ -869,8 +875,8 @@ bool PolicyHandler::ReceiveMessageFromSDK(const std::string& file, ); std::vector<std::string> vehicle_data_args; vehicle_data_args.push_back(strings::odometer); - MessageHelper::CreateGetVehicleDataRequest(correlation_id, - vehicle_data_args , application_manager_); + MessageHelper::CreateGetVehicleDataRequest( + correlation_id, vehicle_data_args, application_manager_); } else { LOG4CXX_WARN(logger_, "Exchange wasn't successful, trying another one."); OnPTExchangeNeeded(); @@ -990,7 +996,8 @@ void PolicyHandler::OnActivateApp(uint32_t connection_key, LOG4CXX_WARN(logger_, "Application should not be activated"); } - MessageHelper::SendSDLActivateAppResponse(permissions, correlation_id, application_manager_); + MessageHelper::SendSDLActivateAppResponse( + permissions, correlation_id, application_manager_); } void PolicyHandler::KmsChanged(int kilometers) { @@ -1004,7 +1011,8 @@ void PolicyHandler::PTExchangeAtUserRequest(uint32_t correlation_id) { LOG4CXX_TRACE(logger_, "PT exchange at user request"); POLICY_LIB_CHECK_VOID(); std::string update_status = policy_manager_->ForcePTExchange(); - MessageHelper::SendUpdateSDLResponse(update_status, correlation_id, application_manager_); + MessageHelper::SendUpdateSDLResponse( + update_status, correlation_id, application_manager_); } void PolicyHandler::OnPermissionsUpdated(const std::string& policy_app_id, @@ -1013,8 +1021,8 @@ void PolicyHandler::OnPermissionsUpdated(const std::string& policy_app_id, LOG4CXX_AUTO_TRACE(logger_); OnPermissionsUpdated(policy_app_id, permissions); - ApplicationSharedPtr app = application_manager_.application_by_policy_id( - policy_app_id); + ApplicationSharedPtr app = + application_manager_.application_by_policy_id(policy_app_id); if (!app.valid()) { LOG4CXX_WARN( logger_, @@ -1046,13 +1054,11 @@ void PolicyHandler::OnPermissionsUpdated(const std::string& policy_app_id, << default_hmi); if (hmi_level == mobile_apis::HMILevel::HMI_FULL) { - application_manager_.state_controller().SetRegularState(app, - hmi_level, - true); + application_manager_.state_controller().SetRegularState( + app, hmi_level, true); } else { - application_manager_.state_controller().SetRegularState(app, - hmi_level, - false); + application_manager_.state_controller().SetRegularState( + app, hmi_level, false); } break; } @@ -1068,8 +1074,8 @@ void PolicyHandler::OnPermissionsUpdated(const std::string& policy_app_id, void PolicyHandler::OnPermissionsUpdated(const std::string& policy_app_id, const Permissions& permissions) { LOG4CXX_AUTO_TRACE(logger_); - ApplicationSharedPtr app = application_manager_.application_by_policy_id( - policy_app_id); + ApplicationSharedPtr app = + application_manager_.application_by_policy_id(policy_app_id); if (!app.valid()) { LOG4CXX_WARN( logger_, @@ -1077,8 +1083,8 @@ void PolicyHandler::OnPermissionsUpdated(const std::string& policy_app_id, return; } - MessageHelper::SendOnPermissionsChangeNotification(app->app_id(), - permissions ,application_manager_); + MessageHelper::SendOnPermissionsChangeNotification( + app->app_id(), permissions, application_manager_); LOG4CXX_DEBUG(logger_, "Notification sent for application_id:" @@ -1088,7 +1094,8 @@ void PolicyHandler::OnPermissionsUpdated(const std::string& policy_app_id, bool PolicyHandler::SaveSnapshot(const BinaryMessage& pt_string, std::string& snap_path) { - const std::string& policy_snapshot_file_name = get_settings().policies_snapshot_file_name(); + const std::string& policy_snapshot_file_name = + get_settings().policies_snapshot_file_name(); const std::string& system_files_path = get_settings().system_files_path(); snap_path = system_files_path + '/' + policy_snapshot_file_name; @@ -1130,7 +1137,8 @@ void PolicyHandler::CheckPermissions(const PTString& app_id, policy_manager_->CheckPermissions(app_id, hmi_level, rpc, rpc_params, result); } -uint32_t PolicyHandler::GetNotificationsNumber(const std::string& priority) const { +uint32_t PolicyHandler::GetNotificationsNumber( + const std::string& priority) const { POLICY_LIB_CHECK(0); return policy_manager_->GetNotificationsNumber(priority); } @@ -1152,7 +1160,7 @@ bool PolicyHandler::GetInitialAppData(const std::string& application_id, StringArray* app_hmi_types) { POLICY_LIB_CHECK(false); return policy_manager_->GetInitialAppData( - application_id, nicknames, app_hmi_types); + application_id, nicknames, app_hmi_types); } void PolicyHandler::GetServiceUrls(const std::string& service_type, @@ -1246,8 +1254,8 @@ void PolicyHandler::OnSystemError(int code) { custom_str::CustomString PolicyHandler::GetAppName( const std::string& policy_app_id) { - ApplicationSharedPtr app = application_manager_.application_by_policy_id( - policy_app_id); + ApplicationSharedPtr app = + application_manager_.application_by_policy_id(policy_app_id); if (!app.valid()) { LOG4CXX_WARN( diff --git a/src/components/application_manager/src/policies/pt_exchange_handler_ext.cc b/src/components/application_manager/src/policies/pt_exchange_handler_ext.cc index df1761ef66..e1d5199063 100644 --- a/src/components/application_manager/src/policies/pt_exchange_handler_ext.cc +++ b/src/components/application_manager/src/policies/pt_exchange_handler_ext.cc @@ -43,19 +43,16 @@ using application_manager::MessageHelper; using profile::Profile; using std::string; - namespace policy { CREATE_LOGGERPTR_GLOBAL(logger_, "PolicyHandler") PTExchangeHandlerExt::PTExchangeHandlerExt(PolicyHandler* policy_handler) - : PTExchangeHandler(), - policy_handler_(policy_handler) { + : PTExchangeHandler(), policy_handler_(policy_handler) { DCHECK(policy_handler_); } -PTExchangeHandlerExt::~PTExchangeHandlerExt() { -} +PTExchangeHandlerExt::~PTExchangeHandlerExt() {} void PTExchangeHandlerExt::Start() { LOG4CXX_TRACE(logger_, "Start exchange PT"); @@ -64,17 +61,20 @@ void PTExchangeHandlerExt::Start() { policy_handler_->get_settings().policies_snapshot_file_name(); const std::string system_files_path = policy_handler_->get_settings().system_files_path(); - const std::string policy_snapshot_full_path = system_files_path + '/' + - policy_snapshot_file_name; + const std::string policy_snapshot_full_path = + system_files_path + '/' + policy_snapshot_file_name; BinaryMessageSptr pt_snapshot = policy_handler_->RequestPTUpdate(); if (pt_snapshot.valid()) { if (file_system::CreateDirectoryRecursively(system_files_path) && file_system::WriteBinaryFile(policy_snapshot_full_path, *pt_snapshot)) { - MessageHelper::SendPolicyUpdate(policy_snapshot_full_path, - policy_handler_->TimeoutExchange(), - policy_handler_->RetrySequenceDelaysSeconds()); + MessageHelper::SendPolicyUpdate( + policy_snapshot_full_path, + policy_handler_->TimeoutExchange(), + policy_handler_->RetrySequenceDelaysSeconds()); } else { - LOG4CXX_ERROR(logger_, "Failed to write snapshot file to " << policy_snapshot_file_name); + LOG4CXX_ERROR(logger_, + "Failed to write snapshot file to " + << policy_snapshot_file_name); } } else { LOG4CXX_ERROR(logger_, "Failed to obtain policy table snapshot"); diff --git a/src/components/application_manager/src/request_controller.cc b/src/components/application_manager/src/request_controller.cc index 4c014e203b..57db5f6fa1 100644 --- a/src/components/application_manager/src/request_controller.cc +++ b/src/components/application_manager/src/request_controller.cc @@ -71,7 +71,7 @@ void RequestController::InitializeThreadpool() { pool_state_ = TPoolState::STARTED; char name[50]; for (uint32_t i = 0; i < pool_size_; i++) { - snprintf(name, sizeof(name)/sizeof(name[0]), "AM Pool %d", i); + snprintf(name, sizeof(name) / sizeof(name[0]), "AM Pool %d", i); pool_.push_back(threads::CreateThread(name, new Worker(this))); pool_[i]->start(); LOG4CXX_DEBUG(logger_, "Request thread initialized: " << name); @@ -95,7 +95,7 @@ void RequestController::DestroyThreadpool() { pool_.clear(); } -RequestController::TResult RequestController::CheckPosibilitytoAdd( +RequestController::TResult RequestController::CheckPosibilitytoAdd( const RequestPtr request) { LOG4CXX_AUTO_TRACE(logger_); const uint32_t& app_hmi_level_none_time_scale = @@ -103,16 +103,14 @@ RequestController::TResult RequestController::CheckPosibilitytoAdd( // app_hmi_level_none_max_request_per_time_scale const uint32_t& hmi_level_none_count = - settings_.app_hmi_level_none_time_scale_max_requests(); + settings_.app_hmi_level_none_time_scale_max_requests(); - const uint32_t& app_time_scale = - settings_.app_time_scale(); + const uint32_t& app_time_scale = settings_.app_time_scale(); const uint32_t& max_request_per_time_scale = - settings_.app_time_scale_max_requests(); + settings_.app_time_scale_max_requests(); - const uint32_t& pending_requests_amount = - settings_.pending_requests_amount(); + const uint32_t& pending_requests_amount = settings_.pending_requests_amount(); if (!CheckPendingRequestsAmount(pending_requests_amount)) { LOG4CXX_ERROR(logger_, "Too many pending request"); @@ -120,16 +118,17 @@ RequestController::TResult RequestController::CheckPosibilitytoAdd( } if (!waiting_for_response_.CheckHMILevelTimeScaleMaxRequest( - mobile_apis::HMILevel::HMI_NONE, - request->connection_key(), - app_hmi_level_none_time_scale, - hmi_level_none_count)) { + mobile_apis::HMILevel::HMI_NONE, + request->connection_key(), + app_hmi_level_none_time_scale, + hmi_level_none_count)) { LOG4CXX_ERROR(logger_, "Too many application requests in hmi level NONE"); return RequestController::NONE_HMI_LEVEL_MANY_REQUESTS; } - if (!waiting_for_response_.CheckTimeScaleMaxRequest(request->connection_key(), - app_time_scale, - max_request_per_time_scale)) { + if (!waiting_for_response_.CheckTimeScaleMaxRequest( + request->connection_key(), + app_time_scale, + max_request_per_time_scale)) { LOG4CXX_ERROR(logger_, "Too many application requests"); return RequestController::TOO_MANY_REQUESTS; } @@ -144,8 +143,10 @@ bool RequestController::CheckPendingRequestsAmount( const bool available_to_add = pending_requests_amount > pending_requests_size; if (!available_to_add) { - LOG4CXX_WARN(logger_, "Pending requests count " << pending_requests_size - << " exceed application limit " << pending_requests_amount); + LOG4CXX_WARN(logger_, + "Pending requests count " << pending_requests_size + << " exceed application limit " + << pending_requests_amount); } return available_to_add; } @@ -154,23 +155,24 @@ bool RequestController::CheckPendingRequestsAmount( } RequestController::TResult RequestController::addMobileRequest( - const RequestPtr request, - const mobile_apis::HMILevel::eType& hmi_level) { + const RequestPtr request, const mobile_apis::HMILevel::eType& hmi_level) { LOG4CXX_AUTO_TRACE(logger_); if (!request) { LOG4CXX_ERROR(logger_, "Null Pointer request"); cond_var_.NotifyOne(); return INVALID_DATA; } - LOG4CXX_DEBUG(logger_, "correlation_id : " << request->correlation_id() - << "connection_key : " << request->connection_key()); + LOG4CXX_DEBUG( + logger_, + "correlation_id : " << request->correlation_id() + << "connection_key : " << request->connection_key()); RequestController::TResult result = CheckPosibilitytoAdd(request); - if (SUCCESS ==result) { + if (SUCCESS == result) { AutoLock auto_lock_list(mobile_request_list_lock_); mobile_request_list_.push_back(request); - LOG4CXX_DEBUG(logger_, "Waiting for execution: " - << mobile_request_list_.size()); - // wake up one thread that is waiting for a task to be available + LOG4CXX_DEBUG(logger_, + "Waiting for execution: " << mobile_request_list_.size()); + // wake up one thread that is waiting for a task to be available } cond_var_.NotifyOne(); return result; @@ -186,16 +188,19 @@ RequestController::TResult RequestController::addHMIRequest( } LOG4CXX_DEBUG(logger_, " correlation_id : " << request->correlation_id()); - const uint64_t timeout_in_mseconds = static_cast<uint64_t>(request->default_timeout()); - RequestInfoPtr request_info_ptr(new HMIRequestInfo(request, - timeout_in_mseconds)); + const uint64_t timeout_in_mseconds = + static_cast<uint64_t>(request->default_timeout()); + RequestInfoPtr request_info_ptr( + new HMIRequestInfo(request, timeout_in_mseconds)); if (0 == timeout_in_mseconds) { - LOG4CXX_DEBUG (logger_, "Default timeout was set to 0." - "RequestController will not track timeout of this request."); + LOG4CXX_DEBUG(logger_, + "Default timeout was set to 0." + "RequestController will not track timeout of this request."); } waiting_for_response_.Add(request_info_ptr); - LOG4CXX_DEBUG(logger_, "Waiting for response count:" << waiting_for_response_.Size()); + LOG4CXX_DEBUG(logger_, + "Waiting for response count:" << waiting_for_response_.Size()); UpdateTimer(); return RequestController::SUCCESS; @@ -210,7 +215,7 @@ void RequestController::removeNotification( const commands::Command* notification) { LOG4CXX_AUTO_TRACE(logger_); std::list<RequestPtr>::iterator it = notification_list_.begin(); - for (; notification_list_.end() != it; ) { + for (; notification_list_.end() != it;) { if (it->get() == notification) { notification_list_.erase(it++); LOG4CXX_DEBUG(logger_, "Notification removed"); @@ -222,18 +227,18 @@ void RequestController::removeNotification( LOG4CXX_DEBUG(logger_, "Cant find notification"); } -void RequestController::terminateRequest( - const uint32_t& correlation_id, - const uint32_t& connection_key, bool force_terminate) { +void RequestController::terminateRequest(const uint32_t& correlation_id, + const uint32_t& connection_key, + bool force_terminate) { LOG4CXX_AUTO_TRACE(logger_); - LOG4CXX_DEBUG(logger_, "correlation_id = " << correlation_id - << " connection_key = " << connection_key - << " force_terminate = " << force_terminate); - RequestInfoPtr request = waiting_for_response_.Find(connection_key, - correlation_id); + LOG4CXX_DEBUG(logger_, + "correlation_id = " + << correlation_id << " connection_key = " << connection_key + << " force_terminate = " << force_terminate); + RequestInfoPtr request = + waiting_for_response_.Find(connection_key, correlation_id); if (request) { - if (force_terminate || - request->request()->AllowedToTerminate()) { + if (force_terminate || request->request()->AllowedToTerminate()) { waiting_for_response_.RemoveRequest(request); } else { LOG4CXX_WARN(logger_, "Request was not terminated"); @@ -244,14 +249,13 @@ void RequestController::terminateRequest( } } -void RequestController::OnMobileResponse( - const uint32_t& mobile_correlation_id, - const uint32_t& connection_key) { +void RequestController::OnMobileResponse(const uint32_t& mobile_correlation_id, + const uint32_t& connection_key) { LOG4CXX_AUTO_TRACE(logger_); terminateRequest(mobile_correlation_id, connection_key); } -void RequestController::OnHMIResponse(const uint32_t &correlation_id) { +void RequestController::OnHMIResponse(const uint32_t& correlation_id) { LOG4CXX_AUTO_TRACE(logger_); terminateRequest(correlation_id, RequestInfo::HmiConnectoinKey); } @@ -259,39 +263,39 @@ void RequestController::OnHMIResponse(const uint32_t &correlation_id) { void RequestController::terminateWaitingForExecutionAppRequests( const uint32_t& app_id) { LOG4CXX_AUTO_TRACE(logger_); - LOG4CXX_DEBUG(logger_, "app_id: " << app_id - << "Waiting for execution" << mobile_request_list_.size()); + LOG4CXX_DEBUG(logger_, + "app_id: " << app_id << "Waiting for execution" + << mobile_request_list_.size()); AutoLock auto_lock(mobile_request_list_lock_); - std::list<RequestPtr>::iterator request_it = - mobile_request_list_.begin(); + std::list<RequestPtr>::iterator request_it = mobile_request_list_.begin(); while (mobile_request_list_.end() != request_it) { RequestPtr request = (*request_it); - if ((request.valid()) && (request->connection_key() == app_id)) { + if ((request.valid()) && (request->connection_key() == app_id)) { mobile_request_list_.erase(request_it++); } else { ++request_it; } } - LOG4CXX_DEBUG(logger_, "Waiting for execution " - << mobile_request_list_.size()); + LOG4CXX_DEBUG(logger_, + "Waiting for execution " << mobile_request_list_.size()); } void RequestController::terminateWaitingForResponseAppRequests( const uint32_t& app_id) { LOG4CXX_AUTO_TRACE(logger_); waiting_for_response_.RemoveByConnectionKey(app_id); - LOG4CXX_DEBUG(logger_, "Waiting for response count : " - << waiting_for_response_.Size()); + LOG4CXX_DEBUG( + logger_, "Waiting for response count : " << waiting_for_response_.Size()); } -void RequestController::terminateAppRequests( - const uint32_t& app_id) { +void RequestController::terminateAppRequests(const uint32_t& app_id) { LOG4CXX_AUTO_TRACE(logger_); - LOG4CXX_DEBUG(logger_, "app_id : " << app_id - << "Requests waiting for execution count : " - << mobile_request_list_.size() - << "Requests waiting for response count : " - << waiting_for_response_.Size()); + LOG4CXX_DEBUG(logger_, + "app_id : " << app_id + << "Requests waiting for execution count : " + << mobile_request_list_.size() + << "Requests waiting for response count : " + << waiting_for_response_.Size()); terminateWaitingForExecutionAppRequests(app_id); terminateWaitingForResponseAppRequests(app_id); @@ -313,18 +317,19 @@ void RequestController::terminateAllMobileRequests() { UpdateTimer(); } -void RequestController::updateRequestTimeout( - const uint32_t& app_id, - const uint32_t& correlation_id, - const uint32_t& new_timeout) { +void RequestController::updateRequestTimeout(const uint32_t& app_id, + const uint32_t& correlation_id, + const uint32_t& new_timeout) { LOG4CXX_AUTO_TRACE(logger_); - LOG4CXX_DEBUG(logger_, "app_id : " << app_id - << " mobile_correlation_id : " << correlation_id - << " new_timeout : " << new_timeout); - LOG4CXX_DEBUG(logger_, "New_timeout is NULL. RequestCtrl will " - "not manage this request any more"); - + LOG4CXX_DEBUG(logger_, + "app_id : " << app_id + << " mobile_correlation_id : " << correlation_id + << " new_timeout : " << new_timeout); + LOG4CXX_DEBUG(logger_, + "New_timeout is NULL. RequestCtrl will " + "not manage this request any more"); + RequestInfoPtr request_info = waiting_for_response_.Find(app_id, correlation_id); if (request_info) { @@ -332,14 +337,15 @@ void RequestController::updateRequestTimeout( request_info->updateTimeOut(new_timeout); waiting_for_response_.Add(request_info); UpdateTimer(); - LOG4CXX_INFO(logger_, "Timeout updated for " - << " app_id: " << app_id - << " correlation_id: " << correlation_id - << " new_timeout (ms): " << new_timeout); + LOG4CXX_INFO(logger_, + "Timeout updated for " + << " app_id: " << app_id << " correlation_id: " + << correlation_id << " new_timeout (ms): " << new_timeout); } else { - LOG4CXX_ERROR(logger_, "Can't find request with " - << " app_id: " << app_id - << " correlation_id: " << correlation_id); + LOG4CXX_ERROR(logger_, + "Can't find request with " + << " app_id: " << app_id + << " correlation_id: " << correlation_id); } } @@ -363,25 +369,28 @@ bool RequestController::IsLowVoltage() { void RequestController::onTimer() { LOG4CXX_AUTO_TRACE(logger_); - LOG4CXX_DEBUG(logger_, "ENTER Waiting fore response count: " - << waiting_for_response_.Size()); + LOG4CXX_DEBUG( + logger_, + "ENTER Waiting fore response count: " << waiting_for_response_.Size()); RequestInfoPtr probably_expired = waiting_for_response_.FrontWithNotNullTimeout(); while (probably_expired && probably_expired->isExpired()) { - LOG4CXX_INFO(logger_, "Timeout for " - << (RequestInfo::HMIRequest - == probably_expired ->requst_type() ? "HMI": "Mobile") - << " request id: " - << probably_expired ->requestId() - << " connection_key: " << - probably_expired ->app_id() << " is expired"); + LOG4CXX_INFO(logger_, + "Timeout for " + << (RequestInfo::HMIRequest == + probably_expired->requst_type() + ? "HMI" + : "Mobile") + << " request id: " << probably_expired->requestId() + << " connection_key: " << probably_expired->app_id() + << " is expired"); const uint32_t experied_request_id = probably_expired->requestId(); const uint32_t experied_app_id = probably_expired->app_id(); probably_expired->request()->onTimeOut(); - if (RequestInfo::HmiConnectoinKey == probably_expired ->app_id()) { - LOG4CXX_DEBUG(logger_, "Erase HMI request: " - << probably_expired ->requestId()); + if (RequestInfo::HmiConnectoinKey == probably_expired->app_id()) { + LOG4CXX_DEBUG(logger_, + "Erase HMI request: " << probably_expired->requestId()); waiting_for_response_.RemoveRequest(probably_expired); } probably_expired = waiting_for_response_.FrontWithNotNullTimeout(); @@ -394,17 +403,15 @@ void RequestController::onTimer() { } } UpdateTimer(); - LOG4CXX_DEBUG(logger_, "EXIT Waiting for response count : " - << waiting_for_response_.Size()); + LOG4CXX_DEBUG( + logger_, + "EXIT Waiting for response count : " << waiting_for_response_.Size()); } RequestController::Worker::Worker(RequestController* requestController) - : request_controller_(requestController) - , stop_flag_(false) { -} + : request_controller_(requestController), stop_flag_(false) {} -RequestController::Worker::~Worker() { -} +RequestController::Worker::~Worker() {} void RequestController::Worker::threadMain() { LOG4CXX_AUTO_TRACE(logger_); @@ -432,15 +439,15 @@ void RequestController::Worker::threadMain() { break; } - RequestPtr request_ptr( request_controller_->mobile_request_list_.front()); - request_controller_->mobile_request_list_.pop_front(); + RequestPtr request_ptr(request_controller_->mobile_request_list_.front()); + request_controller_->mobile_request_list_.pop_front(); bool init_res = request_ptr->Init(); // to setup specific - // default timeout + // default timeout const uint32_t timeout_in_mseconds = request_ptr->default_timeout(); - RequestInfoPtr request_info_ptr(new MobileRequestInfo(request_ptr, - timeout_in_mseconds)); + RequestInfoPtr request_info_ptr( + new MobileRequestInfo(request_ptr, timeout_in_mseconds)); request_controller_->waiting_for_response_.Add(request_info_ptr); LOG4CXX_DEBUG(logger_, "timeout_in_mseconds " << timeout_in_mseconds); @@ -448,7 +455,8 @@ void RequestController::Worker::threadMain() { if (0 != timeout_in_mseconds) { request_controller_->UpdateTimer(); } else { - LOG4CXX_DEBUG(logger_, "Default timeout was set to 0. " + LOG4CXX_DEBUG(logger_, + "Default timeout was set to 0. " "RequestController will not track timeout " "of this request."); } @@ -458,9 +466,10 @@ void RequestController::Worker::threadMain() { // execute if ((false == request_controller_->IsLowVoltage()) && request_ptr->CheckPermissions() && init_res) { - LOG4CXX_DEBUG(logger_, "Execute MobileRequest corr_id = " - << request_info_ptr->requestId() - << " with timeout: " << timeout_in_mseconds); + LOG4CXX_DEBUG(logger_, + "Execute MobileRequest corr_id = " + << request_info_ptr->requestId() + << " with timeout: " << timeout_in_mseconds); request_ptr->Run(); } } @@ -482,22 +491,25 @@ void RequestController::UpdateTimer() { TimevalStruct end_time = front->end_time(); date_time::DateTime::AddMilliseconds(end_time, delay_time); if (current_time < end_time) { - const uint32_t msecs =static_cast<uint32_t>(date_time::DateTime::getmSecs(end_time - current_time) ); - LOG4CXX_DEBUG(logger_, "Sleep for " << msecs << " millisecs" ); + const uint32_t msecs = static_cast<uint32_t>( + date_time::DateTime::getmSecs(end_time - current_time)); + LOG4CXX_DEBUG(logger_, "Sleep for " << msecs << " millisecs"); // Timeout for bigger than 5 minutes is a mistake timer_.Start(msecs, true); } else { - LOG4CXX_WARN(logger_, "Request app_id: " << front->app_id() - << " correlation_id: " << front->requestId() - << " is expired. " - << "End time (ms): " - << date_time::DateTime::getmSecs(end_time) - << " Current time (ms): " - << date_time::DateTime::getmSecs(current_time) - << " Diff (current - end) (ms): " - << date_time::DateTime::getmSecs(current_time - end_time) - << " Request timeout (sec): " - << front->timeout_msec()/date_time::DateTime::MILLISECONDS_IN_SECOND); + LOG4CXX_WARN( + logger_, + "Request app_id: " + << front->app_id() << " correlation_id: " << front->requestId() + << " is expired. " + << "End time (ms): " << date_time::DateTime::getmSecs(end_time) + << " Current time (ms): " + << date_time::DateTime::getmSecs(current_time) + << " Diff (current - end) (ms): " + << date_time::DateTime::getmSecs(current_time - end_time) + << " Request timeout (sec): " + << front->timeout_msec() / + date_time::DateTime::MILLISECONDS_IN_SECOND); timer_.Start(0u, true); } } diff --git a/src/components/application_manager/src/resumption/resume_ctrl.cc b/src/components/application_manager/src/resumption/resume_ctrl.cc index 02440b13a6..608ec29167 100644 --- a/src/components/application_manager/src/resumption/resume_ctrl.cc +++ b/src/components/application_manager/src/resumption/resume_ctrl.cc @@ -56,8 +56,8 @@ using namespace application_manager; CREATE_LOGGERPTR_GLOBAL(logger_, "Resumption") ResumeCtrl::ResumeCtrl(ApplicationManager& application_manager) - : event_engine::EventObserver(application_manager.event_dispatcher()), - queue_lock_(false) + : event_engine::EventObserver(application_manager.event_dispatcher()) + , queue_lock_(false) , restore_hmi_level_timer_( "RsmCtrlRstore", new timer::TimerTaskImpl<ResumeCtrl>( @@ -103,16 +103,17 @@ bool ResumeCtrl::Init(resumption::LastState& last_state) { db->UpdateDBVersion(); } } else { - resumption_storage_.reset(new ResumptionDataJson(last_state, - application_manager_)); + resumption_storage_.reset( + new ResumptionDataJson(last_state, application_manager_)); if (!resumption_storage_->Init()) { - LOG4CXX_DEBUG(logger_, "Resumption storage initialisation failed"); - return false; + LOG4CXX_DEBUG(logger_, "Resumption storage initialisation failed"); + return false; } } LoadResumeData(); save_persistent_data_timer_.Start( - application_manager_.get_settings().app_resumption_save_persistent_data_timeout(), + application_manager_.get_settings() + .app_resumption_save_persistent_data_timeout(), true); return true; } @@ -213,14 +214,13 @@ bool ResumeCtrl::SetAppHMIState(ApplicationSharedPtr application, using namespace mobile_apis; LOG4CXX_AUTO_TRACE(logger_); DCHECK_OR_RETURN(application, false); - LOG4CXX_TRACE( - logger_, - " app_id : " << application->app_id() << ", hmi_level : " << hmi_level - << ", check_policy : " - << check_policy); + LOG4CXX_TRACE(logger_, + " app_id : " << application->app_id() + << ", hmi_level : " << hmi_level + << ", check_policy : " << check_policy); const std::string& device_mac = application->mac_address(); if (check_policy && - application_manager_.GetUserConsentForDevice(device_mac) != + application_manager_.GetUserConsentForDevice(device_mac) != policy::DeviceConsent::kDeviceAllowed) { LOG4CXX_ERROR(logger_, "Resumption abort. Data consent wasn't allowed."); SetupDefaultHMILevel(application); @@ -231,8 +231,7 @@ bool ResumeCtrl::SetAppHMIState(ApplicationSharedPtr application, hmi_level); LOG4CXX_INFO(logger_, "Application with policy id " << application->policy_app_id() - << " got HMI level " - << hmi_level); + << " got HMI level " << hmi_level); return true; } @@ -277,7 +276,9 @@ void ResumeCtrl::StartSavePersistentDataTimer() { LOG4CXX_AUTO_TRACE(logger_); if (!save_persistent_data_timer_.is_running()) { save_persistent_data_timer_.Start( - application_manager_.get_settings().app_resumption_save_persistent_data_timeout(), true); + application_manager_.get_settings() + .app_resumption_save_persistent_data_timeout(), + true); } } @@ -292,20 +293,17 @@ bool ResumeCtrl::StartResumption(ApplicationSharedPtr application, const std::string& hash) { LOG4CXX_AUTO_TRACE(logger_); DCHECK_OR_RETURN(application, false); - LOG4CXX_DEBUG(logger_, - " Resume app_id = " << application->app_id() << " hmi_app_id = " - << application->hmi_app_id() - << " policy_id = " - << application->policy_app_id() - << " received hash = " - << hash); + LOG4CXX_DEBUG( + logger_, + " Resume app_id = " << application->app_id() + << " hmi_app_id = " << application->hmi_app_id() + << " policy_id = " << application->policy_app_id() + << " received hash = " << hash); SetupDefaultHMILevel(application); smart_objects::SmartObject saved_app; const std::string& device_mac = application->mac_address(); bool result = resumption_storage_->GetSavedApplication( - application->policy_app_id(), - device_mac, - saved_app); + application->policy_app_id(), device_mac, saved_app); if (result) { const std::string& saved_hash = saved_app[strings::hash_id].asString(); result = saved_hash == hash ? RestoreApplicationData(application) : false; @@ -324,18 +322,14 @@ bool ResumeCtrl::StartResumptionOnlyHMILevel(ApplicationSharedPtr application) { } LOG4CXX_DEBUG(logger_, "HMI level resumption requested for application id " - << application->app_id() - << "with hmi_app_id " - << application->hmi_app_id() - << ", policy_app_id " + << application->app_id() << "with hmi_app_id " + << application->hmi_app_id() << ", policy_app_id " << application->policy_app_id()); SetupDefaultHMILevel(application); const std::string& device_mac = application->mac_address(); smart_objects::SmartObject saved_app; bool result = resumption_storage_->GetSavedApplication( - application->policy_app_id(), - device_mac, - saved_app); + application->policy_app_id(), device_mac, saved_app); if (result) { // sync_primitives::AutoUnlock unlock(lock); AddToResumptionTimerQueue(application->app_id()); @@ -351,9 +345,7 @@ void ResumeCtrl::StartAppHmiStateResumption(ApplicationSharedPtr application) { smart_objects::SmartObject saved_app; const std::string& device_mac = application->mac_address(); bool result = resumption_storage_->GetSavedApplication( - application->policy_app_id(), - device_mac, - saved_app); + application->policy_app_id(), device_mac, saved_app); DCHECK_OR_RETURN_VOID(result); const uint32_t ign_off_count = saved_app[strings::ign_off_count].asUInt(); bool restore_data_allowed = false; @@ -387,9 +379,7 @@ bool ResumeCtrl::CheckPersistenceFilesForResumption( smart_objects::SmartObject saved_app; const std::string& device_mac = application->mac_address(); bool result = resumption_storage_->GetSavedApplication( - application->policy_app_id(), - device_mac, - saved_app); + application->policy_app_id(), device_mac, saved_app); if (result) { if (!CheckIcons(application, saved_app[strings::application_commands])) { return false; @@ -410,9 +400,7 @@ bool ResumeCtrl::CheckApplicationHash(ApplicationSharedPtr application, smart_objects::SmartObject saved_app; const std::string& device_mac = application->mac_address(); bool result = resumption_storage_->GetSavedApplication( - application->policy_app_id(), - device_mac, - saved_app); + application->policy_app_id(), device_mac, saved_app); return result ? saved_app[strings::hash_id].asString() == hash : false; } @@ -447,9 +435,7 @@ bool ResumeCtrl::RestoreApplicationData(ApplicationSharedPtr application) { smart_objects::SmartObject saved_app(smart_objects::SmartType_Map); const std::string& device_mac = application->mac_address(); bool result = resumption_storage_->GetSavedApplication( - application->policy_app_id(), - device_mac, - saved_app); + application->policy_app_id(), device_mac, saved_app); if (result) { if (saved_app.keyExists(strings::grammar_id)) { const uint32_t app_grammar_id = saved_app[strings::grammar_id].asUInt(); @@ -512,8 +498,8 @@ void ResumeCtrl::AddSubmenues(ApplicationSharedPtr application, const smart_objects::SmartObject& submenu = app_submenus[i]; application->AddSubMenu(submenu[strings::menu_id].asUInt(), submenu); } - ProcessHMIRequests( - MessageHelper::CreateAddSubMenuRequestToHMI(application, application_manager_.GetNextHMICorrelationID())); + ProcessHMIRequests(MessageHelper::CreateAddSubMenuRequestToHMI( + application, application_manager_.GetNextHMICorrelationID())); } else { LOG4CXX_FATAL(logger_, "application_submenus section is not exists"); } @@ -531,8 +517,8 @@ void ResumeCtrl::AddCommands(ApplicationSharedPtr application, application->AddCommand(command[strings::cmd_id].asUInt(), command); } - ProcessHMIRequests( - MessageHelper::CreateAddCommandRequestToHMI(application, application_manager_)); + ProcessHMIRequests(MessageHelper::CreateAddCommandRequestToHMI( + application, application_manager_)); } else { LOG4CXX_FATAL(logger_, "application_commands section is not exists"); } @@ -551,8 +537,8 @@ void ResumeCtrl::AddChoicesets(ApplicationSharedPtr application, choice_set[strings::interaction_choice_set_id].asInt(); application->AddChoiceSet(choice_set_id, choice_set); } - ProcessHMIRequests( - MessageHelper::CreateAddVRCommandRequestFromChoiceToHMI(application, application_manager_)); + ProcessHMIRequests(MessageHelper::CreateAddVRCommandRequestFromChoiceToHMI( + application, application_manager_)); } else { LOG4CXX_FATAL(logger_, "There is no any choicesets"); } @@ -571,8 +557,9 @@ void ResumeCtrl::SetGlobalProperties( } } -void ResumeCtrl::AddWayPointsSubscription(app_mngr::ApplicationSharedPtr application, - const smart_objects::SmartObject& saved_app) { +void ResumeCtrl::AddWayPointsSubscription( + app_mngr::ApplicationSharedPtr application, + const smart_objects::SmartObject& saved_app) { LOG4CXX_AUTO_TRACE(logger_); if (saved_app.keyExists(strings::subscribed_for_way_points)) { @@ -601,7 +588,8 @@ void ResumeCtrl::AddSubscriptions(ApplicationSharedPtr application, application->SubscribeToButton(btn); } } - MessageHelper::SendAllOnButtonSubscriptionNotificationsForApp(application, application_manager_); + MessageHelper::SendAllOnButtonSubscriptionNotificationsForApp( + application, application_manager_); if (subscribtions.keyExists(strings::application_vehicle_info)) { const smart_objects::SmartObject& subscribtions_ivi = @@ -611,8 +599,8 @@ void ResumeCtrl::AddSubscriptions(ApplicationSharedPtr application, ivi = static_cast<VehicleDataType>((subscribtions_ivi[i]).asInt()); application->SubscribeToIVI(ivi); } - ProcessHMIRequests( - MessageHelper::GetIVISubscriptionRequests(application, application_manager_)); + ProcessHMIRequests(MessageHelper::GetIVISubscriptionRequests( + application, application_manager_)); } } } @@ -647,11 +635,11 @@ bool ResumeCtrl::DisconnectedJustBeforeIgnOff( const uint32_t sec_spent_before_ign = labs(ign_off_time - time_stamp); LOG4CXX_DEBUG( logger_, - "ign_off_time " << ign_off_time << "; app_disconnect_time " << time_stamp - << "; sec_spent_before_ign " - << sec_spent_before_ign - << "; resumption_delay_before_ign " - << application_manager_.get_settings().resumption_delay_before_ign()); + "ign_off_time " + << ign_off_time << "; app_disconnect_time " << time_stamp + << "; sec_spent_before_ign " << sec_spent_before_ign + << "; resumption_delay_before_ign " + << application_manager_.get_settings().resumption_delay_before_ign()); return sec_spent_before_ign <= application_manager_.get_settings().resumption_delay_before_ign(); } @@ -673,8 +661,7 @@ bool ResumeCtrl::CheckAppRestrictions( : false; LOG4CXX_DEBUG(logger_, "is_media_app " << is_media_app << "; hmi_level " << hmi_level - << " result " - << result); + << " result " << result); return result; } @@ -693,13 +680,12 @@ bool ResumeCtrl::CheckDelayAfterIgnOn() { const time_t curr_time = time(NULL); const time_t sdl_launch_time = launch_time(); const uint32_t seconds_from_sdl_start = labs(curr_time - sdl_launch_time); - const uint32_t wait_time = application_manager_.get_settings().resumption_delay_after_ign(); + const uint32_t wait_time = + application_manager_.get_settings().resumption_delay_after_ign(); LOG4CXX_DEBUG(logger_, "curr_time " << curr_time << "; sdl_launch_time " - << sdl_launch_time - << "; seconds_from_sdl_start " - << seconds_from_sdl_start - << "; wait_time " + << sdl_launch_time << "; seconds_from_sdl_start " + << seconds_from_sdl_start << "; wait_time " << wait_time); return seconds_from_sdl_start <= wait_time; } @@ -767,9 +753,10 @@ void ResumeCtrl::LoadResumeData() { const std::string device_id = application[strings::device_id].asString(); const std::string app_id = application[strings::app_id].asString(); LOG4CXX_INFO(logger_, "Data resumption is expired."); - LOG4CXX_DEBUG(logger_, "Resumption data for application " << app_id - << " and device id " << device_id - << " will be dropped."); + LOG4CXX_DEBUG(logger_, + "Resumption data for application " + << app_id << " and device id " << device_id + << " will be dropped."); resumption_storage_->DropAppDataResumption(device_id, app_id); continue; } @@ -777,10 +764,12 @@ void ResumeCtrl::LoadResumeData() { } void ResumeCtrl::OnAppRegistrationStart(const std::string& policy_app_id, - const std::string& device_id) { + const std::string& device_id) { LOG4CXX_AUTO_TRACE(logger_); if (IsApplicationSaved(policy_app_id, device_id)) { - LOG4CXX_INFO(logger_, "Application is found in resumption " + LOG4CXX_INFO( + logger_, + "Application is found in resumption " "data and will try to resume. Stopping resume data persistent timer"); StopSavePersistentDataTimer(); } @@ -797,6 +786,4 @@ bool ResumeCtrl::IsAppDataResumptionExpired( return max_ign_off_count <= application[strings::ign_off_count].asInt(); } - - } // namespce resumption diff --git a/src/components/application_manager/src/resumption/resumption_data.cc b/src/components/application_manager/src/resumption/resumption_data.cc index f7332a796d..a44a22425b 100644 --- a/src/components/application_manager/src/resumption/resumption_data.cc +++ b/src/components/application_manager/src/resumption/resumption_data.cc @@ -40,7 +40,8 @@ namespace resumption { CREATE_LOGGERPTR_GLOBAL(logger_, "Resumption") -ResumptionData::ResumptionData(const application_manager::ApplicationManager& application_manager) +ResumptionData::ResumptionData( + const application_manager::ApplicationManager& application_manager) : resumption_lock_(true), application_manager_(application_manager) {} smart_objects::SmartObject ResumptionData::GetApplicationCommands( @@ -68,8 +69,8 @@ smart_objects::SmartObject ResumptionData::GetApplicationSubMenus( LOG4CXX_AUTO_TRACE(logger_); DCHECK(application.get()); - smart_objects::SmartObject submenues_array = smart_objects::SmartObject( - smart_objects::SmartType_Array); + smart_objects::SmartObject submenues_array = + smart_objects::SmartObject(smart_objects::SmartType_Array); if (!application) { LOG4CXX_ERROR(logger_, "NULL Pointer App"); @@ -78,14 +79,14 @@ smart_objects::SmartObject ResumptionData::GetApplicationSubMenus( const DataAccessor<SubMenuMap> accessor = application->sub_menu_map(); const SubMenuMap& sub_menus = accessor.GetData(); SubMenuMap::const_iterator it = sub_menus.begin(); - for (int i = 0;it != sub_menus.end(); ++it, ++i) { + for (int i = 0; it != sub_menus.end(); ++it, ++i) { submenues_array[i] = *(it->second); } return submenues_array; } smart_objects::SmartObject ResumptionData::GetApplicationInteractionChoiseSets( - app_mngr::ApplicationConstSharedPtr application) const { + app_mngr::ApplicationConstSharedPtr application) const { using namespace app_mngr; LOG4CXX_AUTO_TRACE(logger_); @@ -93,9 +94,9 @@ smart_objects::SmartObject ResumptionData::GetApplicationInteractionChoiseSets( smart_objects::SmartObject interaction_choice_set_array = smart_objects::SmartObject(smart_objects::SmartType_Array); if (!application) { - LOG4CXX_ERROR(logger_, "NULL Pointer App"); - return interaction_choice_set_array; - } + LOG4CXX_ERROR(logger_, "NULL Pointer App"); + return interaction_choice_set_array; + } const DataAccessor<ChoiceSetMap> accessor = application->choice_set_map(); const ChoiceSetMap& choices = accessor.GetData(); ChoiceSetMap::const_iterator it = choices.begin(); @@ -106,7 +107,7 @@ smart_objects::SmartObject ResumptionData::GetApplicationInteractionChoiseSets( } smart_objects::SmartObject ResumptionData::GetApplicationGlobalProperties( - app_mngr::ApplicationConstSharedPtr application) const { + app_mngr::ApplicationConstSharedPtr application) const { using namespace app_mngr; LOG4CXX_AUTO_TRACE(logger_); @@ -131,14 +132,14 @@ smart_objects::SmartObject ResumptionData::GetApplicationGlobalProperties( global_properties[strings::keyboard_properties] = PointerToSmartObj(application->keyboard_props()); global_properties[strings::menu_title] = - PointerToSmartObj(application->menu_title()); + PointerToSmartObj(application->menu_title()); global_properties[strings::menu_icon] = - PointerToSmartObj(application->menu_icon()); + PointerToSmartObj(application->menu_icon()); return global_properties; } smart_objects::SmartObject ResumptionData::GetApplicationSubscriptions( - app_mngr::ApplicationConstSharedPtr application) const { + app_mngr::ApplicationConstSharedPtr application) const { using namespace app_mngr; LOG4CXX_AUTO_TRACE(logger_); DCHECK(application.get()); @@ -156,8 +157,10 @@ smart_objects::SmartObject ResumptionData::GetApplicationSubscriptions( const ButtonSubscriptions& button_subscriptions = button_accessor.GetData(); LOG4CXX_DEBUG(logger_, "SubscribedButtons:" << button_subscriptions.size()); - Append(button_subscriptions.begin(), button_subscriptions.end(), - strings::application_buttons, subscriptions); + Append(button_subscriptions.begin(), + button_subscriptions.end(), + strings::application_buttons, + subscriptions); DataAccessor<VehicleInfoSubscriptions> vi_accessor = application->SubscribedIVI(); @@ -165,8 +168,10 @@ smart_objects::SmartObject ResumptionData::GetApplicationSubscriptions( const VehicleInfoSubscriptions& vi_subscription = vi_accessor.GetData(); LOG4CXX_DEBUG(logger_, "SubscribedIVI:" << vi_subscription.size()); - Append(vi_subscription.begin(), vi_subscription.end(), - strings::application_vehicle_info, subscriptions); + Append(vi_subscription.begin(), + vi_subscription.end(), + strings::application_vehicle_info, + subscriptions); return subscriptions; } @@ -175,8 +180,7 @@ smart_objects::SmartObject ResumptionData::GetApplicationFiles( using namespace app_mngr; LOG4CXX_AUTO_TRACE(logger_); DCHECK(application.get()); - LOG4CXX_TRACE(logger_, "ENTER app_id:" - << application->app_id()); + LOG4CXX_TRACE(logger_, "ENTER app_id:" << application->app_id()); smart_objects::SmartObject files = smart_objects::SmartObject(smart_objects::SmartType_Array); @@ -187,8 +191,9 @@ smart_objects::SmartObject ResumptionData::GetApplicationFiles( const AppFilesMap& app_files = application->getAppFiles(); int i = 0; - for(AppFilesMap::const_iterator file_it = app_files.begin(); - file_it != app_files.end(); file_it++) { + for (AppFilesMap::const_iterator file_it = app_files.begin(); + file_it != app_files.end(); + file_it++) { const AppFile& file = file_it->second; if (file.is_persistent) { smart_objects::SmartObject file_data = 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 b493001c45..063cb332f1 100644 --- a/src/components/application_manager/src/resumption/resumption_data_db.cc +++ b/src/components/application_manager/src/resumption/resumption_data_db.cc @@ -49,9 +49,10 @@ const std::string kDatabaseName = "resumption"; namespace resumption { CREATE_LOGGERPTR_GLOBAL(logger_, "Resumption") -ResumptionDataDB::ResumptionDataDB(const application_manager::ApplicationManager& application_manager) - : ResumptionData(application_manager), - db_(new utils::dbms::SQLDatabase(kDatabaseName)) { +ResumptionDataDB::ResumptionDataDB( + const application_manager::ApplicationManager& application_manager) + : ResumptionData(application_manager) + , db_(new utils::dbms::SQLDatabase(kDatabaseName)) { #ifndef __QNX__ std::string path = application_manager_.get_settings().app_storage_folder(); if (!path.empty()) { @@ -71,10 +72,13 @@ bool ResumptionDataDB::Init() { if (!db_->Open()) { LOG4CXX_ERROR(logger_, "Failed opening database."); LOG4CXX_INFO(logger_, "Starting opening retries."); - const uint16_t attempts = application_manager_.get_settings().attempts_to_open_resumption_db(); + const uint16_t attempts = + application_manager_.get_settings().attempts_to_open_resumption_db(); LOG4CXX_DEBUG(logger_, "Total attempts number is: " << attempts); bool is_opened = false; - const uint16_t open_attempt_timeout_ms = application_manager_.get_settings().open_attempt_timeout_ms_resumption_db(); + const uint16_t open_attempt_timeout_ms = + application_manager_.get_settings() + .open_attempt_timeout_ms_resumption_db(); const useconds_t sleep_interval_mcsec = open_attempt_timeout_ms * 1000; LOG4CXX_DEBUG(logger_, "Open attempt timeout(ms) is: " << open_attempt_timeout_ms); @@ -90,8 +94,7 @@ bool ResumptionDataDB::Init() { if (!is_opened) { LOG4CXX_ERROR(logger_, "Open retry sequence failed. Tried " - << attempts - << " attempts with " + << attempts << " attempts with " << open_attempt_timeout_ms << " open timeout(ms) for each."); return false; @@ -143,11 +146,10 @@ void ResumptionDataDB::SaveApplication( const std::string& device_mac = application->mac_address(); LOG4CXX_INFO(logger_, "app_id : " << application->app_id() << " policy_app_id : " - << policy_app_id - << " device_id : " - << device_mac); + << policy_app_id << " device_id : " << device_mac); - if (!CheckExistenceApplication(policy_app_id, device_mac, application_exist)) { + if (!CheckExistenceApplication( + policy_app_id, device_mac, application_exist)) { LOG4CXX_ERROR(logger_, "Problem with access to DB"); return; } @@ -193,13 +195,10 @@ int32_t ResumptionDataDB::GetStoredHMILevel( int hmi_level; if (SelectHMILevel(policy_app_id, device_id, hmi_level)) { - LOG4CXX_INFO( - logger_, - "Application with policy application id = " << policy_app_id - << " and device id = " - << device_id - << "has hmi level = " - << hmi_level); + LOG4CXX_INFO(logger_, + "Application with policy application id = " + << policy_app_id << " and device id = " << device_id + << "has hmi level = " << hmi_level); return hmi_level; } LOG4CXX_FATAL(logger_, "HMI level doesn't exists in saved data"); @@ -223,10 +222,9 @@ bool ResumptionDataDB::CheckSavedApplication(const std::string& policy_app_id, return false; } LOG4CXX_INFO(logger_, - "Application with policy_app_id = " << policy_app_id - << " and device_id = " - << device_id - << " does exist"); + "Application with policy_app_id = " + << policy_app_id << " and device_id = " << device_id + << " does exist"); return true; } @@ -491,9 +489,7 @@ void ResumptionDataDB::SelectHMIId(const std::string& policy_app_id, LOG4CXX_FATAL(logger_, "Saved data doesn't have application with " "device id = " - << device_id - << " and policy appID = " - << policy_app_id); + << device_id << " and policy appID = " << policy_app_id); } bool ResumptionDataDB::SelectHashId(const std::string& policy_app_id, @@ -525,9 +521,7 @@ bool ResumptionDataDB::SelectHashId(const std::string& policy_app_id, LOG4CXX_WARN(logger_, "Saved data doesn't have application with " "device id = " - << device_id - << " and policy appID = " - << policy_app_id + << device_id << " and policy appID = " << policy_app_id << "or hashID"); return false; } @@ -566,11 +560,9 @@ bool ResumptionDataDB::CheckExistenceApplication( /* Position of data in "query" : amount of application = 0 */ if (result && query.GetInteger(0)) { - LOG4CXX_INFO( - logger_, - "Saved data has application with policy appID = " << policy_app_id - << " and deviceID = " - << device_id); + LOG4CXX_INFO(logger_, + "Saved data has application with policy appID = " + << policy_app_id << " and deviceID = " << device_id); application_exist = true; } else if (result) { LOG4CXX_INFO(logger_, "Saved data does not contain application"); @@ -640,18 +632,15 @@ void ResumptionDataDB::UpdateHmiLevel(const std::string& policy_app_id, if (query.Exec()) { LOG4CXX_INFO(logger_, "Saved data has application with policy appID = " - << policy_app_id - << " and deviceID = " - << device_id - << " has new HMI level = " - << hmi_level); + << policy_app_id << " and deviceID = " << device_id + << " has new HMI level = " << hmi_level); WriteDb(); } } } void ResumptionDataDB::Persist() { - WriteDb(); + WriteDb(); } bool ResumptionDataDB::RefreshDB() const { @@ -761,9 +750,8 @@ bool ResumptionDataDB::DropAppDataResumption(const std::string& device_id, const std::string& app_id) { LOG4CXX_AUTO_TRACE(logger_); - utils::ScopeGuard guard = utils::MakeObjGuard( - *db_, - &utils::dbms::SQLDatabase::RollbackTransaction); + utils::ScopeGuard guard = + utils::MakeObjGuard(*db_, &utils::dbms::SQLDatabase::RollbackTransaction); db_->BeginTransaction(); if (!DeleteSavedFiles(app_id, device_id)) { @@ -784,7 +772,7 @@ bool ResumptionDataDB::DropAppDataResumption(const std::string& device_id, if (!DeleteSavedGlobalProperties(app_id, device_id)) { return false; } - if(!UpdateGrammarID(app_id, device_id, 0)) { + if (!UpdateGrammarID(app_id, device_id, 0)) { return false; } db_->CommitTransaction(); @@ -1468,9 +1456,8 @@ bool ResumptionDataDB::DeleteSavedApplication(const std::string& policy_app_id, const std::string& device_id) { LOG4CXX_AUTO_TRACE(logger_); - utils::ScopeGuard guard = utils::MakeObjGuard( - *db_, - &utils::dbms::SQLDatabase::RollbackTransaction); + utils::ScopeGuard guard = + utils::MakeObjGuard(*db_, &utils::dbms::SQLDatabase::RollbackTransaction); db_->BeginTransaction(); if (!DeleteSavedFiles(policy_app_id, device_id)) { 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 46fb21729e..d9c755835a 100644 --- a/src/components/application_manager/src/resumption/resumption_data_json.cc +++ b/src/components/application_manager/src/resumption/resumption_data_json.cc @@ -45,7 +45,8 @@ namespace Formatters = NsSmartDeviceLink::NsJSONHandler::Formatters; CREATE_LOGGERPTR_GLOBAL(logger_, "Resumption") -ResumptionDataJson::ResumptionDataJson(LastState& last_state, +ResumptionDataJson::ResumptionDataJson( + LastState& last_state, const application_manager::ApplicationManager& application_manager) : ResumptionData(application_manager), last_state_(last_state) {} @@ -57,15 +58,15 @@ void ResumptionDataJson::SaveApplication( const std::string& policy_app_id = application->policy_app_id(); LOG4CXX_DEBUG(logger_, - "app_id : " << application->app_id() << " policy_app_id : " - << policy_app_id); + "app_id : " << application->app_id() + << " policy_app_id : " << policy_app_id); const std::string hash = application->curHash(); const uint32_t grammar_id = application->get_grammar_id(); const uint32_t time_stamp = (uint32_t)time(NULL); const std::string device_mac = application->mac_address(); const mobile_apis::HMILevel::eType hmi_level = application->hmi_level(); - const bool is_subscribed_for_way_points = application_manager_. - IsAppSubscribedForWayPoints(application->app_id()); + const bool is_subscribed_for_way_points = + application_manager_.IsAppSubscribedForWayPoints(application->app_id()); sync_primitives::AutoLock autolock(resumption_lock_); Json::Value tmp; @@ -151,9 +152,7 @@ bool ResumptionDataJson::CheckSavedApplication(const std::string& policy_app_id, LOG4CXX_INFO( logger_, "Resumption data for app_id " - << policy_app_id - << " device id " - << device_id + << policy_app_id << " device id " << device_id << " is corrupted. Remove application from resumption list"); RemoveApplicationFromSaved(policy_app_id, device_id); return false; @@ -386,11 +385,9 @@ void ResumptionDataJson::UpdateHmiLevel( int idx = GetObjectIndex(policy_app_id, device_id); if (-1 == idx) { - LOG4CXX_WARN( - logger_, - "Application isn't saved with mobile_app_id = " << policy_app_id - << " device_id = " - << device_id); + LOG4CXX_WARN(logger_, + "Application isn't saved with mobile_app_id = " + << policy_app_id << " device_id = " << device_id); return; } GetSavedApplications()[idx][strings::hmi_level] = hmi_level; @@ -419,7 +416,8 @@ Json::Value& ResumptionDataJson::GetResumptionData() const { sync_primitives::AutoLock autolock(resumption_lock_); Json::Value& dictionary = last_state().dictionary; if (!dictionary.isMember(strings::resumption)) { - last_state().dictionary[strings::resumption] = Json::Value(Json::objectValue); + last_state().dictionary[strings::resumption] = + Json::Value(Json::objectValue); LOG4CXX_WARN(logger_, "resumption section is missed"); } Json::Value& resumption = dictionary[strings::resumption]; @@ -505,8 +503,9 @@ bool ResumptionDataJson::DropAppDataResumption(const std::string& device_id, sync_primitives::AutoLock autolock(resumption_lock_); Json::Value& application = GetFromSavedOrAppend(app_id, device_id); if (application.isNull()) { - LOG4CXX_DEBUG(logger_, "Application " << app_id << " with device_id " - << device_id << " hasn't been found in resumption data."); + LOG4CXX_DEBUG(logger_, + "Application " << app_id << " with device_id " << device_id + << " hasn't been found in resumption data."); return false; } application[strings::application_commands].clear(); @@ -516,14 +515,15 @@ bool ResumptionDataJson::DropAppDataResumption(const std::string& device_id, application[strings::application_subscribtions].clear(); application[strings::application_files].clear(); application.removeMember(strings::grammar_id); - LOG4CXX_DEBUG(logger_, "Resumption data for application " << app_id << - " with device_id " << device_id << " has been dropped."); + LOG4CXX_DEBUG(logger_, + "Resumption data for application " + << app_id << " with device_id " << device_id + << " has been dropped."); return true; } void ResumptionDataJson::Persist() { - last_state().SaveToFileSystem(); + last_state().SaveToFileSystem(); } - } // resumption diff --git a/src/components/application_manager/src/state_controller_impl.cc b/src/components/application_manager/src/state_controller_impl.cc index a01672a545..839cc13026 100644 --- a/src/components/application_manager/src/state_controller_impl.cc +++ b/src/components/application_manager/src/state_controller_impl.cc @@ -61,8 +61,9 @@ StateControllerImpl::StateControllerImpl(ApplicationManager& app_mngr) subscribe_on_event(hmi_apis::FunctionID::BasicCommunication_OnEventChanged); } - -void StateControllerImpl::SetRegularState(ApplicationSharedPtr app, HmiStatePtr state, const bool send_activate_app) { +void StateControllerImpl::SetRegularState(ApplicationSharedPtr app, + HmiStatePtr state, + const bool send_activate_app) { CREATE_LOGGERPTR_LOCAL(logger_, "StateControllerImpl"); LOG4CXX_AUTO_TRACE(logger_); if (!app) { @@ -74,7 +75,7 @@ void StateControllerImpl::SetRegularState(ApplicationSharedPtr app, HmiStatePtr if (state->hmi_level() == mobile_apis::HMILevel::INVALID_ENUM || state->audio_streaming_state() == - mobile_apis::AudioStreamingState::INVALID_ENUM || + mobile_apis::AudioStreamingState::INVALID_ENUM || state->system_context() == mobile_apis::SystemContext::INVALID_ENUM) { LOG4CXX_ERROR(logger_, "Get invalid state"); return; @@ -92,7 +93,7 @@ void StateControllerImpl::SetRegularState(ApplicationSharedPtr app, HmiStatePtr } hmi_apis::Common_HMILevel::eType hmi_level = static_cast<hmi_apis::Common_HMILevel::eType>( - resolved_state->hmi_level()); + resolved_state->hmi_level()); const bool is_full_allowed = (hmi_apis::Common_HMILevel::FULL == hmi_level); @@ -110,10 +111,11 @@ void StateControllerImpl::SetRegularState(ApplicationSharedPtr app, HmiStatePtr ApplyRegularState(app, resolved_state); } -void StateControllerImpl::SetRegularState(ApplicationSharedPtr app, - const mobile_apis::HMILevel::eType hmi_level, - const mobile_apis::AudioStreamingState::eType audio_state, - const bool send_activate_app) { +void StateControllerImpl::SetRegularState( + ApplicationSharedPtr app, + const mobile_apis::HMILevel::eType hmi_level, + const mobile_apis::AudioStreamingState::eType audio_state, + const bool send_activate_app) { CREATE_LOGGERPTR_LOCAL(logger_, "StateControllerImpl"); LOG4CXX_AUTO_TRACE(logger_); if (!app) { @@ -131,9 +133,10 @@ void StateControllerImpl::SetRegularState(ApplicationSharedPtr app, SetRegularState(app, hmi_state, send_activate_app); } -void StateControllerImpl::SetRegularState(ApplicationSharedPtr app, - const mobile_apis::HMILevel::eType hmi_level, - const bool send_activate_app) { +void StateControllerImpl::SetRegularState( + ApplicationSharedPtr app, + const mobile_apis::HMILevel::eType hmi_level, + const bool send_activate_app) { using namespace mobile_apis; using namespace helpers; CREATE_LOGGERPTR_LOCAL(logger_, "StateControllerImpl"); @@ -152,11 +155,12 @@ void StateControllerImpl::SetRegularState(ApplicationSharedPtr app, SetRegularState(app, hmi_state, send_activate_app); } -void StateControllerImpl::SetRegularState(ApplicationSharedPtr app, - const mobile_apis::HMILevel::eType hmi_level, - const mobile_apis::AudioStreamingState::eType audio_state, - const mobile_apis::SystemContext::eType system_context, - const bool send_activate_app) { +void StateControllerImpl::SetRegularState( + ApplicationSharedPtr app, + const mobile_apis::HMILevel::eType hmi_level, + const mobile_apis::AudioStreamingState::eType audio_state, + const mobile_apis::SystemContext::eType system_context, + const bool send_activate_app) { CREATE_LOGGERPTR_LOCAL(logger_, "StateControllerImpl"); LOG4CXX_AUTO_TRACE(logger_); if (!app) { @@ -172,8 +176,8 @@ void StateControllerImpl::SetRegularState(ApplicationSharedPtr app, SetRegularState(app, hmi_state, send_activate_app); } -void StateControllerImpl::SetRegularState(ApplicationSharedPtr app, - const mobile_apis::HMILevel::eType hmi_level) { +void StateControllerImpl::SetRegularState( + ApplicationSharedPtr app, const mobile_apis::HMILevel::eType hmi_level) { CREATE_LOGGERPTR_LOCAL(logger_, "StateControllerImpl"); LOG4CXX_AUTO_TRACE(logger_); if (!app) { @@ -186,14 +190,15 @@ void StateControllerImpl::SetRegularState(ApplicationSharedPtr app, DCHECK_OR_RETURN_VOID(hmi_state); hmi_state->set_hmi_level(hmi_level); hmi_state->set_audio_streaming_state(CalcAudioState(app, hmi_level)); - hmi_state->set_system_context( - prev_state ? prev_state->system_context() - : mobile_apis::SystemContext::SYSCTXT_MAIN); + hmi_state->set_system_context(prev_state + ? prev_state->system_context() + : mobile_apis::SystemContext::SYSCTXT_MAIN); SetRegularState(app, hmi_state); } -void StateControllerImpl::SetRegularState(ApplicationSharedPtr app, - const mobile_apis::SystemContext::eType system_context) { +void StateControllerImpl::SetRegularState( + ApplicationSharedPtr app, + const mobile_apis::SystemContext::eType system_context) { CREATE_LOGGERPTR_LOCAL(logger_, "StateControllerImpl"); LOG4CXX_AUTO_TRACE(logger_); if (!app) { @@ -207,13 +212,14 @@ void StateControllerImpl::SetRegularState(ApplicationSharedPtr app, DCHECK_OR_RETURN_VOID(hmi_state); hmi_state->set_hmi_level(prev_regular->hmi_level()); hmi_state->set_audio_streaming_state( - CalcAudioState(app, prev_regular->hmi_level())); + CalcAudioState(app, prev_regular->hmi_level())); hmi_state->set_system_context(system_context); SetRegularState(app, hmi_state, false); } -void StateControllerImpl::SetRegularState(ApplicationSharedPtr app, - const mobile_apis::AudioStreamingState::eType audio_state) { +void StateControllerImpl::SetRegularState( + ApplicationSharedPtr app, + const mobile_apis::AudioStreamingState::eType audio_state) { CREATE_LOGGERPTR_LOCAL(logger_, "StateControllerImpl"); LOG4CXX_AUTO_TRACE(logger_); if (!app) { @@ -310,16 +316,15 @@ void StateControllerImpl::HmiLevelConflictResolver::operator()( } HmiStatePtr StateControllerImpl::ResolveHmiState(ApplicationSharedPtr app, - HmiStatePtr state) const { + HmiStatePtr state) const { using namespace mobile_apis; using namespace helpers; LOG4CXX_AUTO_TRACE(logger_); LOG4CXX_DEBUG(logger_, - "State to resolve: hmi_level " << state->hmi_level() - << ", audio_state " - << state->audio_streaming_state() - << ", system_context " - << state->system_context()); + "State to resolve: hmi_level " + << state->hmi_level() << ", audio_state " + << state->audio_streaming_state() << ", system_context " + << state->system_context()); HmiStatePtr available_state = CreateHmiState(app->app_id(), HmiState::StateID::STATE_ID_REGULAR); @@ -340,7 +345,7 @@ HmiStatePtr StateControllerImpl::ResolveHmiState(ApplicationSharedPtr app, } bool StateControllerImpl::IsResumptionAllowed(ApplicationSharedPtr app, - HmiStatePtr state) const { + HmiStatePtr state) const { LOG4CXX_AUTO_TRACE(logger_); using namespace helpers; using namespace mobile_apis; @@ -419,7 +424,7 @@ mobile_apis::HMILevel::eType StateControllerImpl::GetAvailableHmiLevel( } bool StateControllerImpl::IsStateAvailable(ApplicationSharedPtr app, - HmiStatePtr state) const { + HmiStatePtr state) const { using namespace mobile_apis; using namespace helpers; LOG4CXX_AUTO_TRACE(logger_); @@ -447,8 +452,8 @@ bool StateControllerImpl::IsStateAvailable(ApplicationSharedPtr app, return true; } -bool StateControllerImpl::IsStateAvailableForResumption(ApplicationSharedPtr app, - HmiStatePtr state) const { +bool StateControllerImpl::IsStateAvailableForResumption( + ApplicationSharedPtr app, HmiStatePtr state) const { LOG4CXX_AUTO_TRACE(logger_); using namespace mobile_apis; using namespace helpers; @@ -488,7 +493,7 @@ bool StateControllerImpl::IsStateAvailableForResumption(ApplicationSharedPtr app } void StateControllerImpl::SetupRegularHmiState(ApplicationSharedPtr app, - HmiStatePtr state) { + HmiStatePtr state) { namespace HMILevel = mobile_apis::HMILevel; namespace AudioStreamingState = mobile_apis::AudioStreamingState; LOG4CXX_AUTO_TRACE(logger_); @@ -539,7 +544,7 @@ void StateControllerImpl::SetupRegularHmiState( } void StateControllerImpl::ApplyRegularState(ApplicationSharedPtr app, - HmiStatePtr state) { + HmiStatePtr state) { LOG4CXX_AUTO_TRACE(logger_); DCHECK_OR_RETURN_VOID(app); DCHECK_OR_RETURN_VOID(state); @@ -550,7 +555,7 @@ void StateControllerImpl::ApplyRegularState(ApplicationSharedPtr app, } bool StateControllerImpl::IsSameAppType(ApplicationConstSharedPtr app1, - ApplicationConstSharedPtr app2) { + ApplicationConstSharedPtr app2) { const bool both_media = app1->is_media_application() && app2->is_media_application(); const bool both_navi = app1->is_navi() && app2->is_navi(); @@ -658,8 +663,8 @@ void StateControllerImpl::on_event(const event_engine::Event& event) { } void StateControllerImpl::OnStateChanged(ApplicationSharedPtr app, - HmiStatePtr old_state, - HmiStatePtr new_state) { + HmiStatePtr old_state, + HmiStatePtr new_state) { LOG4CXX_AUTO_TRACE(logger_); DCHECK_OR_RETURN_VOID(app); DCHECK_OR_RETURN_VOID(old_state); @@ -742,7 +747,8 @@ int64_t StateControllerImpl::SendBCActivateApp( app_mngr_.connection_handler().get_session_observer(), app_mngr_.GetPolicyHandler(), level, - send_policy_priority, app_mngr_); + send_policy_priority, + app_mngr_); if (!bc_activate_app_request) { LOG4CXX_ERROR(logger_, "Unable to create BC.ActivateAppRequest"); return -1; @@ -884,8 +890,8 @@ bool StateControllerImpl::IsStateActive(HmiState::StateID state_id) const { return false; } -HmiStatePtr StateControllerImpl::CreateHmiState(uint32_t app_id, - HmiState::StateID state_id) const { +HmiStatePtr StateControllerImpl::CreateHmiState( + uint32_t app_id, HmiState::StateID state_id) const { using namespace utils; LOG4CXX_AUTO_TRACE(logger_); HmiStatePtr new_state; diff --git a/src/components/application_manager/test/application_impl_test.cc b/src/components/application_manager/test/application_impl_test.cc index a128f9c4fc..7989f11fce 100644 --- a/src/components/application_manager/test/application_impl_test.cc +++ b/src/components/application_manager/test/application_impl_test.cc @@ -82,19 +82,22 @@ class ApplicationImplTest : public ::testing::Test { testHmiState = CreateTestHmiState(); EXPECT_CALL(mock_application_manager_, CreateRegularState(app_id, _, _, _)) .WillOnce(Return(testHmiState)); - EXPECT_CALL(mock_application_manager_, get_settings()).WillRepeatedly(ReturnRef(mock_application_manager_settings_)); - EXPECT_CALL(mock_application_manager_settings_, app_icons_folder()).WillRepeatedly(ReturnRef(directory_name)); - 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)); - EXPECT_CALL(mock_application_manager_settings_, video_data_stopped_timeout()).WillOnce(Return(0)); + EXPECT_CALL(mock_application_manager_, get_settings()) + .WillRepeatedly(ReturnRef(mock_application_manager_settings_)); + EXPECT_CALL(mock_application_manager_settings_, app_icons_folder()) + .WillRepeatedly(ReturnRef(directory_name)); + 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)); + EXPECT_CALL(mock_application_manager_settings_, + video_data_stopped_timeout()).WillOnce(Return(0)); app_impl = new ApplicationImpl(app_id, policy_app_id, mac_address, app_name, utils::MakeShared<MockStatisticsManager>(), mock_application_manager_); - - } void TearDown() OVERRIDE { delete app_impl; @@ -121,7 +124,6 @@ class ApplicationImplTest : public ::testing::Test { SystemContext::eType syst_context; }; - HmiStatePtr ApplicationImplTest::CreateTestHmiState() { HmiStatePtr testState = utils::MakeShared<HmiState>(app_id, mock_application_manager_, state_id); @@ -498,17 +500,22 @@ TEST_F(ApplicationImplTest, IsCommandLimitsExceeded_SetLimitFromConfig) { TEST_F(ApplicationImplTest, IsCommandLimitsExceeded_LimitFromPT) { policy_test::MockPolicyHandlerInterface policy_interface; - EXPECT_CALL(mock_application_manager_, GetPolicyHandler()).WillRepeatedly(ReturnRef(policy_interface)); - EXPECT_CALL(policy_interface, GetPriority(policy_app_id, _)).WillRepeatedly(Return(false)); + EXPECT_CALL(mock_application_manager_, GetPolicyHandler()) + .WillRepeatedly(ReturnRef(policy_interface)); + EXPECT_CALL(policy_interface, GetPriority(policy_app_id, _)) + .WillRepeatedly(Return(false)); - EXPECT_CALL(policy_interface, GetNotificationsNumber(_)).WillOnce(Return(100u)); + EXPECT_CALL(policy_interface, GetNotificationsNumber(_)) + .WillOnce(Return(100u)); EXPECT_FALSE(app_impl->IsCommandLimitsExceeded(FunctionID::ReadDIDID, TLimitSource::POLICY_TABLE)); - EXPECT_CALL(policy_interface, GetNotificationsNumber(_)).WillOnce(Return(100u)); + EXPECT_CALL(policy_interface, GetNotificationsNumber(_)) + .WillOnce(Return(100u)); EXPECT_FALSE(app_impl->IsCommandLimitsExceeded(FunctionID::GetVehicleDataID, TLimitSource::POLICY_TABLE)); - EXPECT_CALL(policy_interface, GetNotificationsNumber(_)).WillRepeatedly(Return(0)); + EXPECT_CALL(policy_interface, GetNotificationsNumber(_)) + .WillRepeatedly(Return(0)); EXPECT_TRUE(app_impl->IsCommandLimitsExceeded(FunctionID::ReadDIDID, TLimitSource::POLICY_TABLE)); EXPECT_TRUE(app_impl->IsCommandLimitsExceeded(FunctionID::GetVehicleDataID, diff --git a/src/components/application_manager/test/application_state_test.cc b/src/components/application_manager/test/application_state_test.cc index fa22024351..03c18ce186 100644 --- a/src/components/application_manager/test/application_state_test.cc +++ b/src/components/application_manager/test/application_state_test.cc @@ -65,7 +65,6 @@ std::vector<StateID> GenerateCurrentStates() { class ApplicationStateTest : public ::testing::Test { protected: - static std::vector<StateID> added_states_; ApplicationState app_state; const StateID current_id = StateID::STATE_ID_CURRENT; diff --git a/src/components/application_manager/test/event_engine_test.cc b/src/components/application_manager/test/event_engine_test.cc index c3ab82f016..f240f4f25e 100644 --- a/src/components/application_manager/test/event_engine_test.cc +++ b/src/components/application_manager/test/event_engine_test.cc @@ -56,7 +56,7 @@ class EventEngineTest : public testing::Test { : event_id(Event::EventID::BasicCommunication_ActivateApp) , event_id2(Event::EventID::BasicCommunication_OnAppActivated) , event_id3(Event::EventID::VR_IsReady) - , event_observer_mock_(mock_event_dispatcher_) {} + , event_observer_mock_(mock_event_dispatcher_) {} protected: EventDispatcherImpl* event_dispatcher_instance_; @@ -74,7 +74,7 @@ class EventEngineTest : public testing::Test { smart_objects::SmartObject smart_object_with_invalid_type; virtual void SetUp() OVERRIDE { - event_dispatcher_instance_ = new EventDispatcherImpl(); + event_dispatcher_instance_ = new EventDispatcherImpl(); event_ = new Event(hmi_apis::FunctionID::eType::VR_IsReady); smart_object_with_type_notification["params"]["message_type"] = hmi_apis::messageType::notification; @@ -119,8 +119,8 @@ class EventEngineTest : public testing::Test { const uint32_t calls_number, const smart_objects::SmartObject& so) { // Arrange - event_dispatcher_instance_->add_observer(event_id, correlation_id, - event_observer_mock_); + 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); event_dispatcher_instance_->raise_event(*event_); @@ -141,8 +141,9 @@ TEST_F(EventEngineTest, CheckRaiseEvent(event_id3, 1u, smart_object_with_type_response); } -TEST_F(EventEngineTest, - EventDispatcherImpl_RaiseEvent_EventSOTypeErrorResponse_ExpectEventRaised) { +TEST_F( + EventEngineTest, + EventDispatcherImpl_RaiseEvent_EventSOTypeErrorResponse_ExpectEventRaised) { CheckRaiseEvent(event_id3, 1u, smart_object_with_type_error_response); } @@ -165,7 +166,8 @@ TEST_F( TEST_F(EventEngineTest, Event_set_smart_object_ExpectObjectSet) { // Act event_->set_smart_object(smart_object_with_type_notification); - const int32_t obj_type = static_cast<int32_t>(hmi_apis::messageType::notification); + const int32_t obj_type = + static_cast<int32_t>(hmi_apis::messageType::notification); const int32_t function_id = static_cast<int32_t>(hmi_apis::FunctionID::eType::VR_IsReady); // Checks diff --git a/src/components/application_manager/test/hmi_capabilities_test.cc b/src/components/application_manager/test/hmi_capabilities_test.cc index 3f40ae9ab2..235c8685b9 100644 --- a/src/components/application_manager/test/hmi_capabilities_test.cc +++ b/src/components/application_manager/test/hmi_capabilities_test.cc @@ -62,13 +62,16 @@ using namespace application_manager; class HMICapabilitiesTest : public ::testing::Test { protected: - HMICapabilitiesTest(): - last_state_("app_storage_folder", "app_info_data") {} + HMICapabilitiesTest() : last_state_("app_storage_folder", "app_info_data") {} virtual void SetUp() OVERRIDE { - ON_CALL(app_mngr_,event_dispatcher()).WillByDefault(ReturnRef(mock_event_dispatcher)); - ON_CALL(app_mngr_, get_settings()).WillByDefault(ReturnRef(mock_application_manager_settings_)); - ON_CALL(mock_application_manager_settings_, hmi_capabilities_file_name()).WillByDefault(ReturnRef(kFileName)); - hmi_capabilities_test = utils::MakeShared<HMICapabilitiesForTesting>(app_mngr_); + ON_CALL(app_mngr_, event_dispatcher()) + .WillByDefault(ReturnRef(mock_event_dispatcher)); + ON_CALL(app_mngr_, get_settings()) + .WillByDefault(ReturnRef(mock_application_manager_settings_)); + ON_CALL(mock_application_manager_settings_, hmi_capabilities_file_name()) + .WillByDefault(ReturnRef(kFileName)); + hmi_capabilities_test = + utils::MakeShared<HMICapabilitiesForTesting>(app_mngr_); hmi_capabilities_test->Init(&last_state_); } @@ -87,8 +90,7 @@ class HMICapabilitiesTest : public ::testing::Test { resumption::LastState last_state_; MockApplicationManagerSettings mock_application_manager_settings_; utils::SharedPtr<HMICapabilitiesForTesting> hmi_capabilities_test; - const std::string kFileName = "hmi_capabilities.json"; - + const std::string kFileName = "hmi_capabilities.json"; }; const char* const cstring_values_[] = { @@ -163,11 +165,10 @@ TEST_F(HMICapabilitiesTest, LoadCapabilitiesFromFile) { .WillRepeatedly(Invoke(TestCommonLanguageFromString)); if (file_system::FileExists("./app_info_data")) { - EXPECT_TRUE(::file_system::DeleteFile("./app_info_data")); - } + EXPECT_TRUE(::file_system::DeleteFile("./app_info_data")); + } EXPECT_TRUE(hmi_capabilities_test->LoadCapabilitiesFromFile()); - // Check active languages EXPECT_EQ(hmi_apis::Common_Language::EN_US, hmi_capabilities_test->active_ui_language()); @@ -425,7 +426,7 @@ TEST_F(HMICapabilitiesTest, VerifyImageType) { void HMICapabilitiesTest::SetCooperating() { smart_objects::SmartObjectSPtr test_so; EXPECT_CALL(*(MockMessageHelper::message_helper_mock()), - CreateModuleInfoSO(_,_)).WillRepeatedly(Return(test_so)); + CreateModuleInfoSO(_, _)).WillRepeatedly(Return(test_so)); EXPECT_CALL(app_mngr_, ManageHMICommand(_)).WillRepeatedly(Return(true)); } @@ -435,15 +436,14 @@ TEST_F(HMICapabilitiesTest, SetVRCooperating) { smart_objects::SmartObjectSPtr language( new smart_objects::SmartObject(smart_objects::SmartType_Map)); EXPECT_CALL(*(MockMessageHelper::message_helper_mock()), - CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetLanguage,_)) + CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetLanguage, _)) .WillOnce(Return(language)); EXPECT_CALL(app_mngr_, ManageHMICommand(language)); smart_objects::SmartObjectSPtr support_language; - EXPECT_CALL( - *(MockMessageHelper::message_helper_mock()), - CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetSupportedLanguages, _)) - .WillOnce(Return(support_language)); + EXPECT_CALL(*(MockMessageHelper::message_helper_mock()), + CreateModuleInfoSO(hmi_apis::FunctionID::VR_GetSupportedLanguages, + _)).WillOnce(Return(support_language)); EXPECT_CALL(app_mngr_, ManageHMICommand(support_language)); smart_objects::SmartObjectSPtr capabilities; @@ -490,10 +490,9 @@ TEST_F(HMICapabilitiesTest, SetUICooperating) { EXPECT_CALL(app_mngr_, ManageHMICommand(language)); smart_objects::SmartObjectSPtr support_language; - EXPECT_CALL( - *(MockMessageHelper::message_helper_mock()), - CreateModuleInfoSO(hmi_apis::FunctionID::UI_GetSupportedLanguages, _)) - .WillOnce(Return(support_language)); + EXPECT_CALL(*(MockMessageHelper::message_helper_mock()), + CreateModuleInfoSO(hmi_apis::FunctionID::UI_GetSupportedLanguages, + _)).WillOnce(Return(support_language)); EXPECT_CALL(app_mngr_, ManageHMICommand(support_language)); smart_objects::SmartObjectSPtr capabilities; diff --git a/src/components/application_manager/test/include/application_manager/hmi_capabilities_for_testing.h b/src/components/application_manager/test/include/application_manager/hmi_capabilities_for_testing.h index d16fd01f41..ec8e92e859 100644 --- a/src/components/application_manager/test/include/application_manager/hmi_capabilities_for_testing.h +++ b/src/components/application_manager/test/include/application_manager/hmi_capabilities_for_testing.h @@ -42,8 +42,7 @@ namespace application_manager_test { class HMICapabilitiesForTesting : public ::application_manager::HMICapabilities { public: - HMICapabilitiesForTesting( - ::application_manager::ApplicationManager& app_mngr) + HMICapabilitiesForTesting(::application_manager::ApplicationManager& app_mngr) : HMICapabilities(app_mngr) {} bool LoadCapabilitiesFromFile() { return load_capabilities_from_file(); 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 03d0fdc4bd..857172e06f 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 @@ -45,7 +45,7 @@ namespace custom_str = utils::custom_string; namespace smart_objects = NsSmartDeviceLink::NsSmartObjects; class MockApplication : public ::application_manager::Application { public: - MockApplication(){} + MockApplication() {} MOCK_CONST_METHOD0(active_message, const smart_objects::SmartObject*()); MOCK_CONST_METHOD0(curHash, const std::string&()); MOCK_METHOD0(UpdateHash, void()); @@ -70,7 +70,8 @@ class MockApplication : public ::application_manager::Application { MOCK_METHOD1(StartStreaming, void(protocol_handler::ServiceType service_type)); MOCK_METHOD1(StopStreaming, void(protocol_handler::ServiceType service_type)); - MOCK_METHOD1(StopStreamingForce, void(protocol_handler::ServiceType service_type)); + MOCK_METHOD1(StopStreamingForce, + void(protocol_handler::ServiceType service_type)); MOCK_METHOD1(SuspendStreaming, void(protocol_handler::ServiceType service_type)); MOCK_METHOD1(WakeUpStreaming, @@ -99,7 +100,8 @@ class MockApplication : public ::application_manager::Application { MOCK_CONST_METHOD0(device, connection_handler::DeviceHandle()); MOCK_CONST_METHOD0(CurrentHmiState, const application_manager::HmiStatePtr()); MOCK_CONST_METHOD0(RegularHmiState, const application_manager::HmiStatePtr()); - MOCK_CONST_METHOD0(PostponedHmiState, const application_manager::HmiStatePtr()); + MOCK_CONST_METHOD0(PostponedHmiState, + const application_manager::HmiStatePtr()); MOCK_METHOD1(set_tts_properties_in_none, void(bool active)); MOCK_METHOD0(tts_properties_in_none, bool()); MOCK_METHOD1(set_tts_properties_in_full, void(bool active)); @@ -261,8 +263,10 @@ class MockApplication : public ::application_manager::Application { MOCK_CONST_METHOD0(is_perform_interaction_active, uint32_t()); MOCK_METHOD1(set_perform_interaction_mode, void(int32_t mode)); MOCK_CONST_METHOD0(perform_interaction_mode, int32_t()); - MOCK_METHOD1(set_perform_interaction_layout, void(mobile_apis::LayoutMode::eType mode)); - MOCK_CONST_METHOD0(perform_interaction_layout, mobile_apis::LayoutMode::eType()); + MOCK_METHOD1(set_perform_interaction_layout, + void(mobile_apis::LayoutMode::eType mode)); + MOCK_CONST_METHOD0(perform_interaction_layout, + mobile_apis::LayoutMode::eType()); MOCK_METHOD1(set_reset_global_properties_active, void(bool active)); MOCK_CONST_METHOD0(is_reset_global_properties_active, bool()); MOCK_CONST_METHOD0(app_id, uint32_t()); diff --git a/src/components/application_manager/test/include/application_manager/mock_application_manager.h b/src/components/application_manager/test/include/application_manager/mock_application_manager.h index 9fe15b169e..20ed6b2e57 100644 --- a/src/components/application_manager/test/include/application_manager/mock_application_manager.h +++ b/src/components/application_manager/test/include/application_manager/mock_application_manager.h @@ -55,172 +55,184 @@ namespace smart_objects = NsSmartDeviceLink::NsSmartObjects; class MockApplicationManager : public application_manager::ApplicationManager { public: - MOCK_METHOD2(Init, - bool(resumption::LastState& last_state, media_manager::MediaManager* media_manager)); - MOCK_METHOD0(Stop, - bool()); - MOCK_METHOD1(set_hmi_message_handler, - void(hmi_message_handler::HMIMessageHandler* handler)); - MOCK_METHOD1(set_protocol_handler, - void(protocol_handler::ProtocolHandler* handler)); - MOCK_METHOD1(set_connection_handler, - void(connection_handler::ConnectionHandler* handler)); - MOCK_CONST_METHOD0(applications, - DataAccessor<application_manager::ApplicationSet>()); - MOCK_CONST_METHOD1(application, - application_manager::ApplicationSharedPtr(uint32_t app_id)); - MOCK_CONST_METHOD0(active_application, - application_manager::ApplicationSharedPtr()); - MOCK_CONST_METHOD1(application_by_hmi_app, - application_manager::ApplicationSharedPtr(uint32_t hmi_app_id)); - MOCK_CONST_METHOD1(application_by_policy_id, - application_manager::ApplicationSharedPtr(const std::string& policy_app_id)); - MOCK_METHOD1(applications_by_button, - std::vector<application_manager::ApplicationSharedPtr>(uint32_t button)); - MOCK_METHOD0(applications_with_navi, - std::vector<application_manager::ApplicationSharedPtr>()); - MOCK_CONST_METHOD0(get_limited_media_application, - application_manager::ApplicationSharedPtr()); - MOCK_CONST_METHOD0(get_limited_navi_application, - application_manager::ApplicationSharedPtr()); - MOCK_CONST_METHOD0(get_limited_voice_application, - application_manager::ApplicationSharedPtr()); - MOCK_METHOD1(application_id, - uint32_t(const int32_t correlation_id)); - MOCK_METHOD2(set_application_id, - void(const int32_t correlation_id, const uint32_t app_id)); - MOCK_METHOD3(OnHMILevelChanged, - void(uint32_t app_id, mobile_apis::HMILevel::eType from, mobile_apis::HMILevel::eType to)); - MOCK_METHOD1(SendHMIStatusNotification, - void(const utils::SharedPtr<application_manager::Application> app)); - MOCK_METHOD2(SendMessageToMobile, - void(application_manager::commands::MessageSharedPtr, bool)); - MOCK_METHOD1(SendMessageToHMI, - void(const application_manager::commands::MessageSharedPtr message)); - MOCK_METHOD1(ManageHMICommand, - bool(const application_manager::commands::MessageSharedPtr message)); - MOCK_METHOD2(ManageMobileCommand, - bool(const application_manager::commands::MessageSharedPtr message, application_manager::commands::Command::CommandOrigin origin)); - MOCK_CONST_METHOD1(GetDefaultHmiLevel, - mobile_apis::HMILevel::eType(application_manager::ApplicationConstSharedPtr application)); - MOCK_METHOD0(hmi_capabilities, - application_manager::HMICapabilities&()); - MOCK_CONST_METHOD0(hmi_capabilities, - const application_manager::HMICapabilities&()); - MOCK_METHOD2(ProcessQueryApp, - void(const smart_objects::SmartObject& sm_object, const uint32_t connection_key)); - MOCK_CONST_METHOD0(is_attenuated_supported, - bool()); - MOCK_CONST_METHOD1(IsAppTypeExistsInFullOrLimited, - bool(application_manager::ApplicationConstSharedPtr app)); - MOCK_METHOD1(OnApplicationRegistered, - void(application_manager::ApplicationSharedPtr app)); - MOCK_CONST_METHOD0(connection_handler, - connection_handler::ConnectionHandler&()); - MOCK_CONST_METHOD0(protocol_handler, - protocol_handler::ProtocolHandler&()); - MOCK_METHOD0(GetPolicyHandler, - policy::PolicyHandlerInterface&()); - MOCK_METHOD0(GetNextHMICorrelationID, - uint32_t()); - MOCK_METHOD0(GenerateNewHMIAppID, - uint32_t()); - MOCK_METHOD1(EndNaviServices, - void(uint32_t app_id)); - MOCK_METHOD0(BeginAudioPassThrough, - bool()); - MOCK_METHOD0(EndAudioPassThrough, - bool()); - MOCK_METHOD1(ConnectToDevice, - void(const std::string& device_mac)); - MOCK_METHOD0(OnHMIStartedCooperation, - void()); - MOCK_CONST_METHOD0(IsHMICooperating, - bool()); - MOCK_METHOD2(IviInfoUpdated, - std::vector<application_manager::ApplicationSharedPtr>(application_manager::VehicleDataType vehicle_info, int value)); - MOCK_METHOD1(RegisterApplication, - application_manager::ApplicationSharedPtr(const utils::SharedPtr< smart_objects::SmartObject>& request_for_registration)); - MOCK_METHOD0(SendUpdateAppList, - void()); - MOCK_METHOD2(MarkAppsGreyOut, - void(const connection_handler::DeviceHandle handle, bool is_greyed_out)); - MOCK_CONST_METHOD1(IsAppsQueriedFrom, - bool(const connection_handler::DeviceHandle handle)); - MOCK_CONST_METHOD0(IsStopping, - bool()); - MOCK_METHOD1(RemoveAppFromTTSGlobalPropertiesList, - void(const uint32_t app_id)); - MOCK_METHOD4(SaveBinary, - mobile_apis::Result::eType(const std::vector<uint8_t>& binary_data, const std::string& file_path, const std::string& file_name, const int64_t offset)); - MOCK_METHOD1(SetAllAppsAllowed, - void(const bool allowed)); - MOCK_METHOD1(set_driver_distraction, - void(bool is_distracting)); - MOCK_METHOD6(StartAudioPassThruThread, - void(int32_t session_key, int32_t correlation_id, int32_t max_duration, int32_t sampling_rate, int32_t bits_per_sample, int32_t audio_type)); - MOCK_METHOD0(StartDevicesDiscovery, - void()); - MOCK_METHOD1(StopAudioPassThru, - void(int32_t application_key)); - MOCK_METHOD2(TerminateRequest, - void(uint32_t connection_key, uint32_t corr_id)); - MOCK_METHOD4(UnregisterApplication, - void(const uint32_t&, mobile_apis::Result::eType, bool, bool)); - MOCK_METHOD3(updateRequestTimeout, - void(uint32_t connection_key, uint32_t mobile_correlation_id, uint32_t new_timeout_value)); - MOCK_METHOD0(state_controller, - application_manager::StateController&()); - MOCK_METHOD1(SetUnregisterAllApplicationsReason, - void(mobile_apis::AppInterfaceUnregisteredReason::eType reason)); - MOCK_METHOD1(HeadUnitReset, - void(mobile_apis::AppInterfaceUnregisteredReason::eType reason)); - MOCK_CONST_METHOD2(HMILevelAllowsStreaming, - bool(uint32_t app_id, protocol_handler::ServiceType service_type)); - MOCK_METHOD5(CheckPolicyPermissions, - mobile_apis::Result::eType( - const std::string&, - mobile_apis::HMILevel::eType, - mobile_apis::FunctionID::eType, - const application_manager::RPCParams&, - application_manager::CommandParametersPermissions*)); - MOCK_CONST_METHOD2(IsApplicationForbidden, - bool(uint32_t connection_key, const std::string& policy_app_id)); - MOCK_METHOD0(resume_controller, - resumption::ResumeCtrl&()); - MOCK_METHOD1(GetDeviceTransportType, - hmi_apis::Common_TransportType::eType(const std::string& transport_type)); - MOCK_METHOD1(AddAppToTTSGlobalPropertiesList, - void(const uint32_t app_id)); - MOCK_METHOD0(GenerateGrammarID, - uint32_t()); - MOCK_CONST_METHOD1(GetUserConsentForDevice, - policy::DeviceConsent(const std::string& device_id)); - MOCK_METHOD1(OnAppUnauthorized, - void(const uint32_t& app_id)); - MOCK_METHOD1(ActivateApplication, - bool(application_manager::ApplicationSharedPtr app)); - MOCK_METHOD3(OnAppStreaming, - void(uint32_t app_id, protocol_handler::ServiceType service_type, bool state)); - MOCK_CONST_METHOD4(CreateRegularState, - application_manager::HmiStatePtr(uint32_t app_id, mobile_apis::HMILevel::eType hmi_level, mobile_apis::AudioStreamingState::eType audio_state, mobile_apis::SystemContext::eType system_context)); - MOCK_METHOD2(SendAudioPassThroughNotification, - void(uint32_t session_key, std::vector<uint8_t>& binary_data)); - MOCK_CONST_METHOD2(CanAppStream, - bool(uint32_t app_id, protocol_handler::ServiceType service_type)); - MOCK_METHOD1(ForbidStreaming, - void(uint32_t app_id)); - MOCK_CONST_METHOD0(get_settings, - const application_manager::ApplicationManagerSettings&()); - MOCK_METHOD0(event_dispatcher, - application_manager::event_engine::EventDispatcher&()); + MOCK_METHOD2(Init, + bool(resumption::LastState& last_state, + media_manager::MediaManager* media_manager)); + MOCK_METHOD0(Stop, bool()); + MOCK_METHOD1(set_hmi_message_handler, + void(hmi_message_handler::HMIMessageHandler* handler)); + MOCK_METHOD1(set_protocol_handler, + void(protocol_handler::ProtocolHandler* handler)); + MOCK_METHOD1(set_connection_handler, + void(connection_handler::ConnectionHandler* handler)); + MOCK_CONST_METHOD0(applications, + DataAccessor<application_manager::ApplicationSet>()); + MOCK_CONST_METHOD1( + application, application_manager::ApplicationSharedPtr(uint32_t app_id)); + MOCK_CONST_METHOD0(active_application, + application_manager::ApplicationSharedPtr()); + MOCK_CONST_METHOD1( + application_by_hmi_app, + application_manager::ApplicationSharedPtr(uint32_t hmi_app_id)); + MOCK_CONST_METHOD1(application_by_policy_id, + application_manager::ApplicationSharedPtr( + const std::string& policy_app_id)); + MOCK_METHOD1( + applications_by_button, + std::vector<application_manager::ApplicationSharedPtr>(uint32_t button)); + MOCK_METHOD0(applications_with_navi, + std::vector<application_manager::ApplicationSharedPtr>()); + MOCK_CONST_METHOD0(get_limited_media_application, + application_manager::ApplicationSharedPtr()); + MOCK_CONST_METHOD0(get_limited_navi_application, + application_manager::ApplicationSharedPtr()); + MOCK_CONST_METHOD0(get_limited_voice_application, + application_manager::ApplicationSharedPtr()); + MOCK_METHOD1(application_id, uint32_t(const int32_t correlation_id)); + MOCK_METHOD2(set_application_id, + void(const int32_t correlation_id, const uint32_t app_id)); + MOCK_METHOD3(OnHMILevelChanged, + void(uint32_t app_id, + mobile_apis::HMILevel::eType from, + mobile_apis::HMILevel::eType to)); + MOCK_METHOD1( + SendHMIStatusNotification, + void(const utils::SharedPtr<application_manager::Application> app)); + MOCK_METHOD2(SendMessageToMobile, + void(application_manager::commands::MessageSharedPtr, bool)); + MOCK_METHOD1( + SendMessageToHMI, + void(const application_manager::commands::MessageSharedPtr message)); + MOCK_METHOD1( + ManageHMICommand, + bool(const application_manager::commands::MessageSharedPtr message)); + MOCK_METHOD2( + ManageMobileCommand, + bool(const application_manager::commands::MessageSharedPtr message, + application_manager::commands::Command::CommandOrigin origin)); + MOCK_CONST_METHOD1( + GetDefaultHmiLevel, + mobile_apis::HMILevel::eType( + application_manager::ApplicationConstSharedPtr application)); + MOCK_METHOD0(hmi_capabilities, application_manager::HMICapabilities&()); + MOCK_CONST_METHOD0(hmi_capabilities, + const application_manager::HMICapabilities&()); + MOCK_METHOD2(ProcessQueryApp, + void(const smart_objects::SmartObject& sm_object, + const uint32_t connection_key)); + MOCK_CONST_METHOD0(is_attenuated_supported, bool()); + MOCK_CONST_METHOD1(IsAppTypeExistsInFullOrLimited, + bool(application_manager::ApplicationConstSharedPtr app)); + MOCK_METHOD1(OnApplicationRegistered, + void(application_manager::ApplicationSharedPtr app)); + MOCK_CONST_METHOD0(connection_handler, + connection_handler::ConnectionHandler&()); + MOCK_CONST_METHOD0(protocol_handler, protocol_handler::ProtocolHandler&()); + MOCK_METHOD0(GetPolicyHandler, policy::PolicyHandlerInterface&()); + MOCK_METHOD0(GetNextHMICorrelationID, uint32_t()); + MOCK_METHOD0(GenerateNewHMIAppID, uint32_t()); + MOCK_METHOD1(EndNaviServices, void(uint32_t app_id)); + MOCK_METHOD0(BeginAudioPassThrough, bool()); + MOCK_METHOD0(EndAudioPassThrough, bool()); + MOCK_METHOD1(ConnectToDevice, void(const std::string& device_mac)); + MOCK_METHOD0(OnHMIStartedCooperation, void()); + MOCK_CONST_METHOD0(IsHMICooperating, bool()); + MOCK_METHOD2(IviInfoUpdated, + std::vector<application_manager::ApplicationSharedPtr>( + application_manager::VehicleDataType vehicle_info, + int value)); + MOCK_METHOD1(RegisterApplication, + application_manager::ApplicationSharedPtr(const utils::SharedPtr< + smart_objects::SmartObject>& request_for_registration)); + MOCK_METHOD0(SendUpdateAppList, void()); + MOCK_METHOD2(MarkAppsGreyOut, + void(const connection_handler::DeviceHandle handle, + bool is_greyed_out)); + MOCK_CONST_METHOD1(IsAppsQueriedFrom, + bool(const connection_handler::DeviceHandle handle)); + MOCK_CONST_METHOD0(IsStopping, bool()); + MOCK_METHOD1(RemoveAppFromTTSGlobalPropertiesList, + void(const uint32_t app_id)); + MOCK_METHOD4( + SaveBinary, + mobile_apis::Result::eType(const std::vector<uint8_t>& binary_data, + const std::string& file_path, + const std::string& file_name, + const int64_t offset)); + MOCK_METHOD1(SetAllAppsAllowed, void(const bool allowed)); + MOCK_METHOD1(set_driver_distraction, void(bool is_distracting)); + MOCK_METHOD6(StartAudioPassThruThread, + void(int32_t session_key, + int32_t correlation_id, + int32_t max_duration, + int32_t sampling_rate, + int32_t bits_per_sample, + int32_t audio_type)); + MOCK_METHOD0(StartDevicesDiscovery, void()); + MOCK_METHOD1(StopAudioPassThru, void(int32_t application_key)); + MOCK_METHOD2(TerminateRequest, + void(uint32_t connection_key, uint32_t corr_id)); + MOCK_METHOD4(UnregisterApplication, + void(const uint32_t&, mobile_apis::Result::eType, bool, bool)); + MOCK_METHOD3(updateRequestTimeout, + void(uint32_t connection_key, + uint32_t mobile_correlation_id, + uint32_t new_timeout_value)); + MOCK_METHOD0(state_controller, application_manager::StateController&()); + MOCK_METHOD1(SetUnregisterAllApplicationsReason, + void(mobile_apis::AppInterfaceUnregisteredReason::eType reason)); + MOCK_METHOD1(HeadUnitReset, + void(mobile_apis::AppInterfaceUnregisteredReason::eType reason)); + MOCK_CONST_METHOD2(HMILevelAllowsStreaming, + bool(uint32_t app_id, + protocol_handler::ServiceType service_type)); + MOCK_METHOD5(CheckPolicyPermissions, + mobile_apis::Result::eType( + const std::string&, + mobile_apis::HMILevel::eType, + mobile_apis::FunctionID::eType, + const application_manager::RPCParams&, + application_manager::CommandParametersPermissions*)); + MOCK_CONST_METHOD2(IsApplicationForbidden, + bool(uint32_t connection_key, + const std::string& policy_app_id)); + MOCK_METHOD0(resume_controller, resumption::ResumeCtrl&()); + MOCK_METHOD1( + GetDeviceTransportType, + hmi_apis::Common_TransportType::eType(const std::string& transport_type)); + MOCK_METHOD1(AddAppToTTSGlobalPropertiesList, void(const uint32_t app_id)); + MOCK_METHOD0(GenerateGrammarID, uint32_t()); + MOCK_CONST_METHOD1(GetUserConsentForDevice, + policy::DeviceConsent(const std::string& device_id)); + MOCK_METHOD1(OnAppUnauthorized, void(const uint32_t& app_id)); + MOCK_METHOD1(ActivateApplication, + bool(application_manager::ApplicationSharedPtr app)); + MOCK_METHOD3(OnAppStreaming, + void(uint32_t app_id, + protocol_handler::ServiceType service_type, + bool state)); + MOCK_CONST_METHOD4(CreateRegularState, + application_manager::HmiStatePtr( + uint32_t app_id, + mobile_apis::HMILevel::eType hmi_level, + mobile_apis::AudioStreamingState::eType audio_state, + mobile_apis::SystemContext::eType system_context)); + MOCK_METHOD2(SendAudioPassThroughNotification, + void(uint32_t session_key, std::vector<uint8_t>& binary_data)); + MOCK_CONST_METHOD2(CanAppStream, + bool(uint32_t app_id, + protocol_handler::ServiceType service_type)); + MOCK_METHOD1(ForbidStreaming, void(uint32_t app_id)); + MOCK_CONST_METHOD0(get_settings, + const application_manager::ApplicationManagerSettings&()); + MOCK_METHOD0(event_dispatcher, + application_manager::event_engine::EventDispatcher&()); - MOCK_CONST_METHOD1(IsAppSubscribedForWayPoints, bool(const uint32_t)); - MOCK_METHOD1(SubscribeAppForWayPoints, void(const uint32_t)); - MOCK_METHOD1(UnsubscribeAppFromWayPoints, void(const uint32_t)); - MOCK_CONST_METHOD0(IsAnyAppSubscribedForWayPoints, bool()); - MOCK_CONST_METHOD0(GetAppsSubscribedForWayPoints, - const std::set<int32_t>()); + MOCK_CONST_METHOD1(IsAppSubscribedForWayPoints, bool(const uint32_t)); + MOCK_METHOD1(SubscribeAppForWayPoints, void(const uint32_t)); + MOCK_METHOD1(UnsubscribeAppFromWayPoints, void(const uint32_t)); + MOCK_CONST_METHOD0(IsAnyAppSubscribedForWayPoints, bool()); + MOCK_CONST_METHOD0(GetAppsSubscribedForWayPoints, const std::set<int32_t>()); }; } // 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 c92f78c29e..916f4a69f0 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 @@ -42,26 +42,27 @@ namespace test { namespace components { namespace event_engine_test { - -class MockEventDispatcher : public ::application_manager::event_engine::EventDispatcher { +class MockEventDispatcher + : public ::application_manager::event_engine::EventDispatcher { public: MOCK_METHOD1(raise_event, - void(const ::application_manager::event_engine::Event& event)); - MOCK_METHOD3(add_observer, + void(const ::application_manager::event_engine::Event& event)); + MOCK_METHOD3( + add_observer, void(const ::application_manager::event_engine::Event::EventID& event_id, int32_t hmi_correlation_id, ::application_manager::event_engine::EventObserver& observer)); - MOCK_METHOD2(remove_observer, + MOCK_METHOD2( + remove_observer, void(const ::application_manager::event_engine::Event::EventID& event_id, ::application_manager::event_engine::EventObserver& observer)); - MOCK_METHOD1(remove_observer, + MOCK_METHOD1( + remove_observer, void(::application_manager::event_engine::EventObserver& observer)); }; - } // namespace event_engine_test } // namespace components } // namespace test - #endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_INCLUDE_APPLICATION_MANAGER_MOCK_EVENT_DISPATCHER_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 d58213bb02..289b20a105 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 @@ -46,8 +46,8 @@ class MockMessageHelper { public: MOCK_METHOD1(GetHashUpdateNotification, smart_objects::SmartObjectSPtr(const uint32_t app_id)); - MOCK_METHOD2(SendHashUpdateNotification, void(const uint32_t app_id, - ApplicationManager &app_mngr)); + MOCK_METHOD2(SendHashUpdateNotification, + void(const uint32_t app_id, ApplicationManager& app_mngr)); MOCK_METHOD1(HMIResultToString, std::string(hmi_apis::Common_Result::eType hmi_result)); MOCK_METHOD1(HMIResultFromString, @@ -67,47 +67,51 @@ class MockMessageHelper { MOCK_METHOD1(CreateDeviceListSO, smart_objects::SmartObjectSPtr( const connection_handler::DeviceMap& devices)); - MOCK_METHOD2(SendNaviStartStream, void(int32_t connection_key, - ApplicationManager &app_mngr)); - MOCK_METHOD2(SendNaviStopStream, void(int32_t connection_key, - ApplicationManager &app_mngr)); + MOCK_METHOD2(SendNaviStartStream, + void(int32_t connection_key, ApplicationManager& app_mngr)); + MOCK_METHOD2(SendNaviStopStream, + void(int32_t connection_key, ApplicationManager& app_mngr)); MOCK_METHOD3(SendOnAppPermissionsChangedNotification, void(uint32_t connection_key, const policy::AppPermissions& permissions, ApplicationManager& app_mngr)); - MOCK_METHOD2(SendAudioStartStream, void(int32_t connection_key, - ApplicationManager &app_mngr)); - MOCK_METHOD2(SendAudioStopStream, void(int32_t connection_key, - ApplicationManager &app_mngr)); + MOCK_METHOD2(SendAudioStartStream, + void(int32_t connection_key, ApplicationManager& app_mngr)); + MOCK_METHOD2(SendAudioStopStream, + void(int32_t connection_key, ApplicationManager& app_mngr)); MOCK_METHOD3(SendOnDataStreaming, - void(protocol_handler::ServiceType service, bool available, - ApplicationManager &app_mngr)); + void(protocol_handler::ServiceType service, + bool available, + ApplicationManager& app_mngr)); MOCK_METHOD3(CreateGetVehicleDataRequest, void(uint32_t correlation_id, const std::vector<std::string>& params, - ApplicationManager &app_mngr)); + ApplicationManager& app_mngr)); MOCK_METHOD3(SendUpdateSDLResponse, - void(const std::string& result, uint32_t correlation_id, - ApplicationManager &app_mngr)); + void(const std::string& result, + uint32_t correlation_id, + ApplicationManager& app_mngr)); MOCK_METHOD3(SendGetUserFriendlyMessageResponse, void(const std::vector<policy::UserFriendlyMessage>& msg, - uint32_t correlation_id, ApplicationManager &app_mngr)); + uint32_t correlation_id, + ApplicationManager& app_mngr)); MOCK_METHOD3(SendGetStatusUpdateResponse, - void(const std::string& status, uint32_t correlation_id, - ApplicationManager &app_mngr)); - MOCK_METHOD2(SendOnStatusUpdate, void(const std::string& status, - ApplicationManager &app_mngr)); + void(const std::string& status, + uint32_t correlation_id, + ApplicationManager& app_mngr)); + MOCK_METHOD2(SendOnStatusUpdate, + void(const std::string& status, ApplicationManager& app_mngr)); MOCK_METHOD3(SendSDLActivateAppResponse, void(policy::AppPermissions& permissions, uint32_t correlation_id, - ApplicationManager &app_mngr)); - MOCK_METHOD1(SendGetSystemInfoRequest, void(ApplicationManager &app_mngr)); + ApplicationManager& app_mngr)); + MOCK_METHOD1(SendGetSystemInfoRequest, void(ApplicationManager& app_mngr)); MOCK_METHOD4(SendPolicyUpdate, void(const std::string& file_path, int timeout, const std::vector<int>& retries, - ApplicationManager &app_mngr)); + ApplicationManager& app_mngr)); MOCK_METHOD3( SendGetListOfPermissionsResponse, void(const std::vector<policy::FunctionalGroupPermission>& permissions, @@ -128,18 +132,18 @@ class MockMessageHelper { std::string(hmi_apis::Common_Language::eType)); MOCK_METHOD2(CreateModuleInfoSO, smart_objects::SmartObjectSPtr(uint32_t function_id, - ApplicationManager &app_mngr)); + ApplicationManager& app_mngr)); MOCK_METHOD2(SendAllOnButtonSubscriptionNotificationsForApp, void(ApplicationConstSharedPtr app, - ApplicationManager &app_mngr)); - MOCK_METHOD2(SendOnResumeAudioSourceToHMI, void(uint32_t app_id, - ApplicationManager &app_mngr)); + ApplicationManager& app_mngr)); + MOCK_METHOD2(SendOnResumeAudioSourceToHMI, + void(uint32_t app_id, ApplicationManager& app_mngr)); MOCK_METHOD2(CreateAddSubMenuRequestToHMI, smart_objects::SmartObjectList(ApplicationConstSharedPtr app, const uint32_t correlation_id)); MOCK_METHOD2(CreateAddCommandRequestToHMI, smart_objects::SmartObjectList(ApplicationConstSharedPtr app, - ApplicationManager &app_mngr)); + ApplicationManager& app_mngr)); MOCK_METHOD1(CreateAddVRCommandRequestFromChoiceToHMI, smart_objects::SmartObjectList(ApplicationConstSharedPtr app)); MOCK_METHOD1(SendGlobalPropertiesToHMI, void(ApplicationConstSharedPtr app)); @@ -153,10 +157,11 @@ class MockMessageHelper { MOCK_METHOD6(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)); + 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(GetOnAppInterfaceUnregisteredNotificationToMobile, NsSmartDeviceLink::NsSmartObjects::SmartObjectSPtr( int32_t connection_key, 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 6c84fc1077..49c2d0e608 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 @@ -45,8 +45,9 @@ namespace resumption_test { class TestResumptionDataDB : public ResumptionDataDB { public: - TestResumptionDataDB(application_manager_test::MockApplicationManagerSettings& mock_application_manager_settings) - : ResumptionDataDB(mock_application_manager_settings) {} + TestResumptionDataDB(application_manager_test::MockApplicationManagerSettings& + mock_application_manager_settings) + : ResumptionDataDB(mock_application_manager_settings) {} }; } // namespace resumption_test 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 73f2de0544..77e791dc82 100755..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 @@ -65,40 +65,34 @@ using testing::ReturnRef; using testing::Return; TEST(MessageHelperTestCreate, - CreateBlockedByPoliciesResponse_SmartObject_Equal) { + CreateBlockedByPoliciesResponse_SmartObject_Equal) { mobile_apis::FunctionID::eType function_id = mobile_apis::FunctionID::eType::AddCommandID; mobile_apis::Result::eType result = mobile_apis::Result::eType::ABORTED; uint32_t correlation_id = 0; uint32_t connection_key = 0; bool success = false; - + smart_objects::SmartObjectSPtr ptr = MessageHelper::CreateBlockedByPoliciesResponse( - function_id, result, correlation_id, connection_key); + function_id, result, correlation_id, connection_key); EXPECT_TRUE(ptr); smart_objects::SmartObject& obj = *ptr; - - EXPECT_EQ(function_id, - obj[strings::params][strings::function_id].asInt()); - EXPECT_EQ(kResponse, - obj[strings::params][strings::message_type].asInt()); - EXPECT_EQ(success, - obj[strings::msg_params][strings::success].asBool()); - EXPECT_EQ(result, - obj[strings::msg_params][strings::result_code].asInt()); + + EXPECT_EQ(function_id, obj[strings::params][strings::function_id].asInt()); + EXPECT_EQ(kResponse, obj[strings::params][strings::message_type].asInt()); + EXPECT_EQ(success, obj[strings::msg_params][strings::success].asBool()); + EXPECT_EQ(result, obj[strings::msg_params][strings::result_code].asInt()); EXPECT_EQ(correlation_id, - obj[strings::params][strings::correlation_id].asUInt()); + obj[strings::params][strings::correlation_id].asUInt()); EXPECT_EQ(connection_key, - obj[strings::params][strings::connection_key].asUInt()); - EXPECT_EQ(kV2, - obj[strings::params][strings::protocol_version].asInt()); + obj[strings::params][strings::connection_key].asUInt()); + EXPECT_EQ(kV2, obj[strings::params][strings::protocol_version].asInt()); } -TEST(MessageHelperTestCreate, - CreateSetAppIcon_SendNullPathImagetype_Equal) { +TEST(MessageHelperTestCreate, CreateSetAppIcon_SendNullPathImagetype_Equal) { std::string path_to_icon = ""; uint32_t app_id = 0; smart_objects::SmartObjectSPtr ptr = @@ -107,18 +101,17 @@ TEST(MessageHelperTestCreate, EXPECT_TRUE(ptr); smart_objects::SmartObject& obj = *ptr; - + int image_type = static_cast<int>(mobile_api::ImageType::DYNAMIC); - + EXPECT_EQ(path_to_icon, - obj[strings::sync_file_name][strings::value].asString()); + obj[strings::sync_file_name][strings::value].asString()); EXPECT_EQ(image_type, - obj[strings::sync_file_name][strings::image_type].asInt()); + obj[strings::sync_file_name][strings::image_type].asInt()); EXPECT_EQ(app_id, obj[strings::app_id].asUInt()); } -TEST(MessageHelperTestCreate, - CreateSetAppIcon_SendPathImagetype_Equal) { +TEST(MessageHelperTestCreate, CreateSetAppIcon_SendPathImagetype_Equal) { std::string path_to_icon = "/qwe/qwe/"; uint32_t app_id = 10; smart_objects::SmartObjectSPtr ptr = @@ -131,14 +124,14 @@ TEST(MessageHelperTestCreate, int image_type = static_cast<int>(mobile_api::ImageType::DYNAMIC); EXPECT_EQ(path_to_icon, - obj[strings::sync_file_name][strings::value].asString()); + obj[strings::sync_file_name][strings::value].asString()); EXPECT_EQ(image_type, - obj[strings::sync_file_name][strings::image_type].asInt()); + obj[strings::sync_file_name][strings::image_type].asInt()); EXPECT_EQ(app_id, obj[strings::app_id].asUInt()); } TEST(MessageHelperTestCreate, - CreateGlobalPropertiesRequestsToHMI_SmartObject_EmptyList) { + CreateGlobalPropertiesRequestsToHMI_SmartObject_EmptyList) { MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>(); EXPECT_CALL(*appSharedMock, vr_help_title()).Times(AtLeast(1)); EXPECT_CALL(*appSharedMock, vr_help()).Times(AtLeast(1)); @@ -152,7 +145,7 @@ TEST(MessageHelperTestCreate, } TEST(MessageHelperTestCreate, - CreateGlobalPropertiesRequestsToHMI_SmartObject_NotEmpty) { + CreateGlobalPropertiesRequestsToHMI_SmartObject_NotEmpty) { MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>(); smart_objects::SmartObjectSPtr objPtr = MakeShared<smart_objects::SmartObject>(); @@ -164,23 +157,30 @@ TEST(MessageHelperTestCreate, (*objPtr)[4][strings::menu_icon] = "555"; (*objPtr)[5][strings::help_prompt] = "666"; (*objPtr)[6][strings::timeout_prompt] = "777"; - - EXPECT_CALL(*appSharedMock, - vr_help_title()).Times(AtLeast(3)).WillRepeatedly(Return(&(*objPtr)[0])); - EXPECT_CALL(*appSharedMock, - vr_help()).Times(AtLeast(2)).WillRepeatedly(Return(&(*objPtr)[1])); - EXPECT_CALL(*appSharedMock, - help_prompt()).Times(AtLeast(3)).WillRepeatedly(Return(&(*objPtr)[5])); - EXPECT_CALL(*appSharedMock, - timeout_prompt()).Times(AtLeast(2)).WillRepeatedly(Return(&(*objPtr)[6])); - EXPECT_CALL(*appSharedMock, - keyboard_props()).Times(AtLeast(2)).WillRepeatedly(Return(&(*objPtr)[2])); - EXPECT_CALL(*appSharedMock, - menu_title()).Times(AtLeast(2)).WillRepeatedly(Return(&(*objPtr)[3])); - EXPECT_CALL(*appSharedMock, - menu_icon()).Times(AtLeast(2)).WillRepeatedly(Return(&(*objPtr)[4])); + + EXPECT_CALL(*appSharedMock, vr_help_title()) + .Times(AtLeast(3)) + .WillRepeatedly(Return(&(*objPtr)[0])); + EXPECT_CALL(*appSharedMock, vr_help()) + .Times(AtLeast(2)) + .WillRepeatedly(Return(&(*objPtr)[1])); + EXPECT_CALL(*appSharedMock, help_prompt()) + .Times(AtLeast(3)) + .WillRepeatedly(Return(&(*objPtr)[5])); + EXPECT_CALL(*appSharedMock, timeout_prompt()) + .Times(AtLeast(2)) + .WillRepeatedly(Return(&(*objPtr)[6])); + EXPECT_CALL(*appSharedMock, keyboard_props()) + .Times(AtLeast(2)) + .WillRepeatedly(Return(&(*objPtr)[2])); + EXPECT_CALL(*appSharedMock, menu_title()) + .Times(AtLeast(2)) + .WillRepeatedly(Return(&(*objPtr)[3])); + EXPECT_CALL(*appSharedMock, menu_icon()) + .Times(AtLeast(2)) + .WillRepeatedly(Return(&(*objPtr)[4])); EXPECT_CALL(*appSharedMock, app_id()).WillRepeatedly(Return(0)); - + smart_objects::SmartObjectList ptr = MessageHelper::CreateGlobalPropertiesRequestsToHMI(appSharedMock, 0u); @@ -188,62 +188,62 @@ TEST(MessageHelperTestCreate, smart_objects::SmartObject& first = *ptr[0]; smart_objects::SmartObject& second = *ptr[1]; - + EXPECT_EQ((*objPtr)[0], first[strings::msg_params][strings::vr_help_title]); EXPECT_EQ((*objPtr)[1], first[strings::msg_params][strings::vr_help]); - EXPECT_EQ((*objPtr)[2], first[strings::msg_params][strings::keyboard_properties]); + EXPECT_EQ((*objPtr)[2], + first[strings::msg_params][strings::keyboard_properties]); EXPECT_EQ((*objPtr)[3], first[strings::msg_params][strings::menu_title]); EXPECT_EQ((*objPtr)[4], first[strings::msg_params][strings::menu_icon]); EXPECT_EQ((*objPtr)[5], second[strings::msg_params][strings::help_prompt]); EXPECT_EQ((*objPtr)[6], second[strings::msg_params][strings::timeout_prompt]); } -TEST(MessageHelperTestCreate, - CreateShowRequestToHMI_SendSmartObject_Equal) { - MockApplicationSharedPtr appSharedMock = - utils::MakeShared<AppMock>(); - +TEST(MessageHelperTestCreate, CreateShowRequestToHMI_SendSmartObject_Equal) { + MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>(); + smart_objects::SmartObjectSPtr smartObjectPtr = utils::MakeShared<smart_objects::SmartObject>(); const smart_objects::SmartObject& object = *smartObjectPtr; - - EXPECT_CALL(*appSharedMock, - show_command()).Times(AtLeast(2)).WillRepeatedly(Return(&object)); - + + EXPECT_CALL(*appSharedMock, show_command()) + .Times(AtLeast(2)) + .WillRepeatedly(Return(&object)); + smart_objects::SmartObjectList ptr = MessageHelper::CreateShowRequestToHMI(appSharedMock, 0u); EXPECT_FALSE(ptr.empty()); smart_objects::SmartObject& obj = *ptr[0]; - + int function_id = static_cast<int>(hmi_apis::FunctionID::UI_Show); - + EXPECT_EQ(function_id, obj[strings::params][strings::function_id].asInt()); EXPECT_EQ(*smartObjectPtr, obj[strings::msg_params]); } TEST(MessageHelperTestCreate, - CreateAddCommandRequestToHMI_SendSmartObject_Empty) { + CreateAddCommandRequestToHMI_SendSmartObject_Empty) { MockApplicationSharedPtr appSharedMock = utils::MakeShared<MockApplication>(); ::application_manager::CommandsMap vis; DataAccessor<application_manager::CommandsMap> data_accessor(vis, true); - - EXPECT_CALL(*appSharedMock, - commands_map()).WillOnce(Return(data_accessor)); + + EXPECT_CALL(*appSharedMock, commands_map()).WillOnce(Return(data_accessor)); application_manager_test::MockApplicationManager mock_application_manager; smart_objects::SmartObjectList ptr = - MessageHelper::CreateAddCommandRequestToHMI(appSharedMock, mock_application_manager); - + MessageHelper::CreateAddCommandRequestToHMI(appSharedMock, + mock_application_manager); + EXPECT_TRUE(ptr.empty()); } TEST(MessageHelperTestCreate, - CreateAddCommandRequestToHMI_SendSmartObject_Equal) { + CreateAddCommandRequestToHMI_SendSmartObject_Equal) { MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>(); CommandsMap vis; - DataAccessor< CommandsMap> data_accessor(vis, true); + DataAccessor<CommandsMap> data_accessor(vis, true); smart_objects::SmartObjectSPtr smartObjectPtr = utils::MakeShared<smart_objects::SmartObject>(); @@ -253,16 +253,14 @@ TEST(MessageHelperTestCreate, object[strings::cmd_icon] = 1; object[strings::cmd_icon][strings::value] = "10"; - vis.insert(std::pair<uint32_t, - smart_objects::SmartObject*>(5, &object)); + vis.insert(std::pair<uint32_t, smart_objects::SmartObject*>(5, &object)); - EXPECT_CALL(*appSharedMock, - commands_map()).WillOnce(Return(data_accessor)); - EXPECT_CALL(*appSharedMock, - app_id()).WillOnce(Return(1u)); + EXPECT_CALL(*appSharedMock, commands_map()).WillOnce(Return(data_accessor)); + EXPECT_CALL(*appSharedMock, app_id()).WillOnce(Return(1u)); application_manager_test::MockApplicationManager mock_application_manager; smart_objects::SmartObjectList ptr = - MessageHelper::CreateAddCommandRequestToHMI(appSharedMock, mock_application_manager); + MessageHelper::CreateAddCommandRequestToHMI(appSharedMock, + mock_application_manager); EXPECT_FALSE(ptr.empty()); @@ -274,30 +272,31 @@ TEST(MessageHelperTestCreate, EXPECT_EQ(1u, obj[strings::msg_params][strings::app_id].asUInt()); EXPECT_EQ(5, obj[strings::msg_params][strings::cmd_id].asInt()); EXPECT_EQ(object[strings::menu_params], - obj[strings::msg_params][strings::menu_params]); + obj[strings::msg_params][strings::menu_params]); EXPECT_EQ(object[strings::cmd_icon], - obj[strings::msg_params][strings::cmd_icon]); - EXPECT_EQ("10", obj[strings::msg_params] - [strings::cmd_icon][strings::value].asString()); + obj[strings::msg_params][strings::cmd_icon]); + EXPECT_EQ( + "10", + obj[strings::msg_params][strings::cmd_icon][strings::value].asString()); } TEST(MessageHelperTestCreate, - CreateAddVRCommandRequestFromChoiceToHMI_SendEmptyData_EmptyList) { + CreateAddVRCommandRequestFromChoiceToHMI_SendEmptyData_EmptyList) { MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>(); application_manager::ChoiceSetMap vis; DataAccessor< ::application_manager::ChoiceSetMap> data_accessor(vis, true); - - EXPECT_CALL(*appSharedMock, - choice_set_map()).WillOnce(Return(data_accessor)); + + EXPECT_CALL(*appSharedMock, choice_set_map()).WillOnce(Return(data_accessor)); application_manager_test::MockApplicationManager mock_application_manager; smart_objects::SmartObjectList ptr = - MessageHelper::CreateAddVRCommandRequestFromChoiceToHMI(appSharedMock, mock_application_manager); - + MessageHelper::CreateAddVRCommandRequestFromChoiceToHMI( + appSharedMock, mock_application_manager); + EXPECT_TRUE(ptr.empty()); } TEST(MessageHelperTestCreate, - CreateAddVRCommandRequestFromChoiceToHMI_SendObject_EqualList) { + CreateAddVRCommandRequestFromChoiceToHMI_SendObject_EqualList) { MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>(); application_manager::ChoiceSetMap vis; DataAccessor< ::application_manager::ChoiceSetMap> data_accessor(vis, true); @@ -305,30 +304,26 @@ TEST(MessageHelperTestCreate, utils::MakeShared<smart_objects::SmartObject>(); smart_objects::SmartObject& object = *smartObjectPtr; - + object[strings::choice_set] = "10"; object[strings::grammar_id] = 111; object[strings::choice_set][0][strings::choice_id] = 1; object[strings::choice_set][0][strings::vr_commands] = 2; - vis.insert(std::pair<uint32_t, - smart_objects::SmartObject*>(5, &object)); - vis.insert(std::pair<uint32_t, - smart_objects::SmartObject*>(6, &object)); - vis.insert(std::pair<uint32_t, - smart_objects::SmartObject*>(7, &object)); - vis.insert(std::pair<uint32_t, - smart_objects::SmartObject*>(8, &object)); - vis.insert(std::pair<uint32_t, - smart_objects::SmartObject*>(9, &object)); - - EXPECT_CALL(*appSharedMock, - choice_set_map()).WillOnce(Return(data_accessor)); - EXPECT_CALL(*appSharedMock, - app_id()).Times(AtLeast(5)).WillRepeatedly(Return(1u)); + vis.insert(std::pair<uint32_t, smart_objects::SmartObject*>(5, &object)); + vis.insert(std::pair<uint32_t, smart_objects::SmartObject*>(6, &object)); + vis.insert(std::pair<uint32_t, smart_objects::SmartObject*>(7, &object)); + vis.insert(std::pair<uint32_t, smart_objects::SmartObject*>(8, &object)); + vis.insert(std::pair<uint32_t, smart_objects::SmartObject*>(9, &object)); + + EXPECT_CALL(*appSharedMock, choice_set_map()).WillOnce(Return(data_accessor)); + EXPECT_CALL(*appSharedMock, app_id()) + .Times(AtLeast(5)) + .WillRepeatedly(Return(1u)); application_manager_test::MockApplicationManager mock_application_manager; smart_objects::SmartObjectList ptr = - MessageHelper::CreateAddVRCommandRequestFromChoiceToHMI(appSharedMock, mock_application_manager); + MessageHelper::CreateAddVRCommandRequestFromChoiceToHMI( + appSharedMock, mock_application_manager); EXPECT_FALSE(ptr.empty()); @@ -341,9 +336,9 @@ TEST(MessageHelperTestCreate, EXPECT_EQ(1u, obj[strings::msg_params][strings::app_id].asUInt()); EXPECT_EQ(111u, obj[strings::msg_params][strings::grammar_id].asUInt()); EXPECT_EQ(object[strings::choice_set][0][strings::choice_id], - obj[strings::msg_params][strings::cmd_id]); + obj[strings::msg_params][strings::cmd_id]); EXPECT_EQ(object[strings::choice_set][0][strings::vr_commands], - obj[strings::msg_params][strings::vr_commands]); + obj[strings::msg_params][strings::vr_commands]); EXPECT_EQ(type, obj[strings::msg_params][strings::type].asInt()); } @@ -359,13 +354,10 @@ TEST(MessageHelperTestCreate, CreateAddSubMenuRequestToHMI_SendObject_Equal) { object[strings::position] = 1; object[strings::menu_name] = 1; - vis.insert(std::pair<uint32_t, - smart_objects::SmartObject*>(5, &object)); + vis.insert(std::pair<uint32_t, smart_objects::SmartObject*>(5, &object)); - EXPECT_CALL(*appSharedMock, - sub_menu_map() ).WillOnce(Return(data_accessor)); - EXPECT_CALL(*appSharedMock, - app_id()).Times(AtLeast(1)).WillOnce(Return(1u)); + EXPECT_CALL(*appSharedMock, sub_menu_map()).WillOnce(Return(data_accessor)); + EXPECT_CALL(*appSharedMock, app_id()).Times(AtLeast(1)).WillOnce(Return(1u)); const uint32_t cor_id = 0u; smart_objects::SmartObjectList ptr = @@ -377,27 +369,24 @@ TEST(MessageHelperTestCreate, CreateAddSubMenuRequestToHMI_SendObject_Equal) { int function_id = static_cast<int>(hmi_apis::FunctionID::UI_AddSubMenu); - EXPECT_EQ(function_id, - obj[strings::params][strings::function_id].asInt()); - EXPECT_EQ(5, - obj[strings::msg_params][strings::menu_id].asInt()); + EXPECT_EQ(function_id, obj[strings::params][strings::function_id].asInt()); + EXPECT_EQ(5, obj[strings::msg_params][strings::menu_id].asInt()); EXPECT_EQ(1, - obj[strings::msg_params] - [strings::menu_params][strings::position].asInt()); - EXPECT_EQ(1, obj[strings::msg_params] - [strings::menu_params][strings::menu_name].asInt()); - EXPECT_EQ(1u, - obj[strings::msg_params][strings::app_id].asUInt()); + obj[strings::msg_params][strings::menu_params][strings::position] + .asInt()); + EXPECT_EQ(1, + obj[strings::msg_params][strings::menu_params][strings::menu_name] + .asInt()); + EXPECT_EQ(1u, obj[strings::msg_params][strings::app_id].asUInt()); } TEST(MessageHelperTestCreate, - CreateAddSubMenuRequestToHMI_SendEmptyMap_EmptySmartObjectList) { + CreateAddSubMenuRequestToHMI_SendEmptyMap_EmptySmartObjectList) { MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>(); application_manager::SubMenuMap vis; DataAccessor< ::application_manager::SubMenuMap> data_accessor(vis, true); - EXPECT_CALL(*appSharedMock, - sub_menu_map() ).WillOnce(Return(data_accessor)); + EXPECT_CALL(*appSharedMock, sub_menu_map()).WillOnce(Return(data_accessor)); const uint32_t cor_id = 0u; smart_objects::SmartObjectList ptr = @@ -412,25 +401,21 @@ TEST(MessageHelperTestCreate, CreateNegativeResponse_SendSmartObject_Equal) { uint32_t correlation_id = 333u; int32_t result_code = 0; - smart_objects::SmartObjectSPtr ptr = - MessageHelper::CreateNegativeResponse(connection_key, function_id, - correlation_id, result_code); + smart_objects::SmartObjectSPtr ptr = MessageHelper::CreateNegativeResponse( + connection_key, function_id, correlation_id, result_code); EXPECT_TRUE(ptr); smart_objects::SmartObject& obj = *ptr; - int objFunction_id = - obj[strings::params][strings::function_id].asInt(); + int objFunction_id = obj[strings::params][strings::function_id].asInt(); uint32_t objCorrelation_id = obj[strings::params][strings::correlation_id].asUInt(); - int objResult_code = - obj[strings::msg_params][strings::result_code].asInt(); + int objResult_code = obj[strings::msg_params][strings::result_code].asInt(); uint32_t objConnection_key = - obj[strings::params][strings::connection_key].asUInt(); + obj[strings::params][strings::connection_key].asUInt(); - int message_type = - static_cast<int>(mobile_apis::messageType::response); + int message_type = static_cast<int>(mobile_apis::messageType::response); int protocol_type = static_cast<int>(commands::CommandImpl::mobile_protocol_type_); int protocol_version = @@ -438,105 +423,164 @@ TEST(MessageHelperTestCreate, CreateNegativeResponse_SendSmartObject_Equal) { bool success = false; EXPECT_EQ(function_id, objFunction_id); - EXPECT_EQ(message_type, - obj[strings::params][strings::message_type].asInt()); + EXPECT_EQ(message_type, obj[strings::params][strings::message_type].asInt()); EXPECT_EQ(protocol_type, - obj[strings::params][strings::protocol_type].asInt()); + obj[strings::params][strings::protocol_type].asInt()); EXPECT_EQ(protocol_version, - obj[strings::params][strings::protocol_version].asInt()); + obj[strings::params][strings::protocol_version].asInt()); EXPECT_EQ(correlation_id, objCorrelation_id); EXPECT_EQ(result_code, objResult_code); - EXPECT_EQ(success, - obj[strings::msg_params][strings::success].asBool()); + EXPECT_EQ(success, obj[strings::msg_params][strings::success].asBool()); EXPECT_EQ(connection_key, objConnection_key); } class MessageHelperTest : public ::testing::Test { - public: - MessageHelperTest() : - language_strings { - "EN-US", "ES-MX", "FR-CA", "DE-DE", "ES-ES", "EN-GB", "RU-RU", - "TR-TR", "PL-PL", "FR-FR", "IT-IT", "SV-SE", "PT-PT", "NL-NL", - "EN-AU", "ZH-CN", "ZH-TW", "JA-JP", "AR-SA", "KO-KR", "PT-BR", - "CS-CZ", "DA-DK", "NO-NO", "NL-BE", "EL-GR", "HU-HU", "FI-FI", - "SK-SK" - }, - hmi_result_strings { - "SUCCESS", "UNSUPPORTED_REQUEST", "UNSUPPORTED_RESOURCE", - "DISALLOWED", "REJECTED", "ABORTED", - "IGNORED", "RETRY", "IN_USE", - "DATA_NOT_AVAILABLE", "TIMED_OUT", "INVALID_DATA", - "CHAR_LIMIT_EXCEEDED", "INVALID_ID", "DUPLICATE_NAME", - "APPLICATION_NOT_REGISTERED", "WRONG_LANGUAGE", "OUT_OF_MEMORY", - "TOO_MANY_PENDING_REQUESTS", "NO_APPS_REGISTERED", - "NO_DEVICES_CONNECTED", "WARNINGS", "GENERIC_ERROR", - "USER_DISALLOWED", "TRUNCATED_DATA" - }, - mobile_result_strings { - "SUCCESS", "UNSUPPORTED_REQUEST", "UNSUPPORTED_RESOURCE", - "DISALLOWED", "REJECTED", "ABORTED", - "IGNORED", "RETRY", "IN_USE", - "VEHICLE_DATA_NOT_AVAILABLE", "TIMED_OUT", "INVALID_DATA", - "CHAR_LIMIT_EXCEEDED", "INVALID_ID", "DUPLICATE_NAME", - "APPLICATION_NOT_REGISTERED", "WRONG_LANGUAGE", "OUT_OF_MEMORY", - "TOO_MANY_PENDING_REQUESTS", "TOO_MANY_APPLICATIONS", - "APPLICATION_REGISTERED_ALREADY", "WARNINGS", "GENERIC_ERROR", - "USER_DISALLOWED", "UNSUPPORTED_VERSION", "VEHICLE_DATA_NOT_ALLOWED", - "FILE_NOT_FOUND", "CANCEL_ROUTE", "TRUNCATED_DATA", - "SAVED", "INVALID_CERT", "EXPIRED_CERT", "RESUME_FAILED" - }, - function_id_strings { - "RESERVED", "RegisterAppInterface", "UnregisterAppInterface", - "SetGlobalProperties", "ResetGlobalProperties", "AddCommand", - "DeleteCommand", "AddSubMenu", "DeleteSubMenu", - "CreateInteractionChoiceSet", "PerformInteraction", - "DeleteInteractionChoiceSet", "Alert", "Show", "Speak", - "SetMediaClockTimer", "PerformAudioPassThru", "EndAudioPassThru", - "SubscribeButton", "UnsubscribeButton", "SubscribeVehicleData", - "UnsubscribeVehicleData", "GetVehicleData", "ReadDID", - "GetDTCs", "ScrollableMessage", "Slider", - "ShowConstantTBT", "AlertManeuver", "UpdateTurnList", - "ChangeRegistration", "GenericResponse", "PutFile", - "DeleteFile", "ListFiles", "SetAppIcon", - "SetDisplayLayout", "DiagnosticMessage", "SystemRequest", - "SendLocation", "DialNumber" - }, - events_id_strings { - "OnHMIStatus", "OnAppInterfaceUnregistered", "OnButtonEvent", - "OnButtonPress", "OnVehicleData", "OnCommand", - "OnTBTClientState", "OnDriverDistraction", "OnPermissionsChange", - "OnAudioPassThru", "OnLanguageChange", "OnKeyboardInput", - "OnTouchEvent", "OnSystemRequest", "OnHashChange" - }, - hmi_level_strings { - "FULL", "LIMITED", - "BACKGROUND", "NONE" - }, - delta_from_functions_id(32768) {} - - protected: - application_manager_test::MockApplicationManager mock_application_manager; - const StringArray language_strings; - const StringArray hmi_result_strings; - const StringArray mobile_result_strings; - const StringArray function_id_strings; - const StringArray events_id_strings; - const StringArray hmi_level_strings; - - const size_t delta_from_functions_id; + public: + MessageHelperTest() + : language_strings{"EN-US", "ES-MX", "FR-CA", "DE-DE", "ES-ES", "EN-GB", + "RU-RU", "TR-TR", "PL-PL", "FR-FR", "IT-IT", "SV-SE", + "PT-PT", "NL-NL", "EN-AU", "ZH-CN", "ZH-TW", "JA-JP", + "AR-SA", "KO-KR", "PT-BR", "CS-CZ", "DA-DK", "NO-NO", + "NL-BE", "EL-GR", "HU-HU", "FI-FI", "SK-SK"} + , hmi_result_strings{"SUCCESS", + "UNSUPPORTED_REQUEST", + "UNSUPPORTED_RESOURCE", + "DISALLOWED", + "REJECTED", + "ABORTED", + "IGNORED", + "RETRY", + "IN_USE", + "DATA_NOT_AVAILABLE", + "TIMED_OUT", + "INVALID_DATA", + "CHAR_LIMIT_EXCEEDED", + "INVALID_ID", + "DUPLICATE_NAME", + "APPLICATION_NOT_REGISTERED", + "WRONG_LANGUAGE", + "OUT_OF_MEMORY", + "TOO_MANY_PENDING_REQUESTS", + "NO_APPS_REGISTERED", + "NO_DEVICES_CONNECTED", + "WARNINGS", + "GENERIC_ERROR", + "USER_DISALLOWED", + "TRUNCATED_DATA"} + , mobile_result_strings{"SUCCESS", + "UNSUPPORTED_REQUEST", + "UNSUPPORTED_RESOURCE", + "DISALLOWED", + "REJECTED", + "ABORTED", + "IGNORED", + "RETRY", + "IN_USE", + "VEHICLE_DATA_NOT_AVAILABLE", + "TIMED_OUT", + "INVALID_DATA", + "CHAR_LIMIT_EXCEEDED", + "INVALID_ID", + "DUPLICATE_NAME", + "APPLICATION_NOT_REGISTERED", + "WRONG_LANGUAGE", + "OUT_OF_MEMORY", + "TOO_MANY_PENDING_REQUESTS", + "TOO_MANY_APPLICATIONS", + "APPLICATION_REGISTERED_ALREADY", + "WARNINGS", + "GENERIC_ERROR", + "USER_DISALLOWED", + "UNSUPPORTED_VERSION", + "VEHICLE_DATA_NOT_ALLOWED", + "FILE_NOT_FOUND", + "CANCEL_ROUTE", + "TRUNCATED_DATA", + "SAVED", + "INVALID_CERT", + "EXPIRED_CERT", + "RESUME_FAILED"} + , function_id_strings{"RESERVED", + "RegisterAppInterface", + "UnregisterAppInterface", + "SetGlobalProperties", + "ResetGlobalProperties", + "AddCommand", + "DeleteCommand", + "AddSubMenu", + "DeleteSubMenu", + "CreateInteractionChoiceSet", + "PerformInteraction", + "DeleteInteractionChoiceSet", + "Alert", + "Show", + "Speak", + "SetMediaClockTimer", + "PerformAudioPassThru", + "EndAudioPassThru", + "SubscribeButton", + "UnsubscribeButton", + "SubscribeVehicleData", + "UnsubscribeVehicleData", + "GetVehicleData", + "ReadDID", + "GetDTCs", + "ScrollableMessage", + "Slider", + "ShowConstantTBT", + "AlertManeuver", + "UpdateTurnList", + "ChangeRegistration", + "GenericResponse", + "PutFile", + "DeleteFile", + "ListFiles", + "SetAppIcon", + "SetDisplayLayout", + "DiagnosticMessage", + "SystemRequest", + "SendLocation", + "DialNumber"} + , events_id_strings{"OnHMIStatus", + "OnAppInterfaceUnregistered", + "OnButtonEvent", + "OnButtonPress", + "OnVehicleData", + "OnCommand", + "OnTBTClientState", + "OnDriverDistraction", + "OnPermissionsChange", + "OnAudioPassThru", + "OnLanguageChange", + "OnKeyboardInput", + "OnTouchEvent", + "OnSystemRequest", + "OnHashChange"} + , hmi_level_strings{"FULL", "LIMITED", "BACKGROUND", "NONE"} + , delta_from_functions_id(32768) {} + + protected: + application_manager_test::MockApplicationManager mock_application_manager; + const StringArray language_strings; + const StringArray hmi_result_strings; + const StringArray mobile_result_strings; + const StringArray function_id_strings; + const StringArray events_id_strings; + const StringArray hmi_level_strings; + + const size_t delta_from_functions_id; }; TEST_F(MessageHelperTest, - CommonLanguageFromString_StringValueOfEnum_CorrectEType) { + CommonLanguageFromString_StringValueOfEnum_CorrectEType) { HmiLanguage::eType enum_value; HmiLanguage::eType enum_from_string_value; // Check all languages >= 0 - for (size_t array_index = 0; - array_index < language_strings.size(); - ++array_index) { + for (size_t array_index = 0; array_index < language_strings.size(); + ++array_index) { enum_value = static_cast<HmiLanguage::eType>(array_index); - enum_from_string_value = MessageHelper::CommonLanguageFromString( - language_strings[array_index]); + enum_from_string_value = + MessageHelper::CommonLanguageFromString(language_strings[array_index]); EXPECT_EQ(enum_value, enum_from_string_value); } // Check InvalidEnum == -1 @@ -546,41 +590,38 @@ TEST_F(MessageHelperTest, } TEST_F(MessageHelperTest, - CommonLanguageToString_ETypeValueOfEnum_CorrectString) { + CommonLanguageToString_ETypeValueOfEnum_CorrectString) { std::string string_from_enum; HmiLanguage::eType casted_enum; // Check all languages >=0 - for (size_t array_index = 0; - array_index < language_strings.size(); - ++array_index) { + for (size_t array_index = 0; array_index < language_strings.size(); + ++array_index) { casted_enum = static_cast<HmiLanguage::eType>(array_index); string_from_enum = MessageHelper::CommonLanguageToString(casted_enum); EXPECT_EQ(language_strings[array_index], string_from_enum); } // Check InvalidEnum == -1 - string_from_enum = MessageHelper::CommonLanguageToString( - HmiLanguage::INVALID_ENUM); + string_from_enum = + MessageHelper::CommonLanguageToString(HmiLanguage::INVALID_ENUM); EXPECT_EQ("", string_from_enum); } -TEST_F(MessageHelperTest, - ConvertEnumAPINoCheck_AnyEnumType_AnotherEnumType) { +TEST_F(MessageHelperTest, ConvertEnumAPINoCheck_AnyEnumType_AnotherEnumType) { hmi_apis::Common_LayoutMode::eType tested_enum_value = hmi_apis::Common_LayoutMode::ICON_ONLY; hmi_apis::Common_AppHMIType::eType converted = - MessageHelper::ConvertEnumAPINoCheck <hmi_apis::Common_LayoutMode::eType, - hmi_apis::Common_AppHMIType::eType>(tested_enum_value); + MessageHelper::ConvertEnumAPINoCheck<hmi_apis::Common_LayoutMode::eType, + hmi_apis::Common_AppHMIType::eType>( + tested_enum_value); EXPECT_EQ(hmi_apis::Common_AppHMIType::DEFAULT, converted); } -TEST_F(MessageHelperTest, - HMIResultFromString_StringValueOfEnum_CorrectEType) { +TEST_F(MessageHelperTest, HMIResultFromString_StringValueOfEnum_CorrectEType) { HmiResults::eType enum_value; HmiResults::eType enum_from_string_value; // Check all results >= 0 - for (size_t array_index = 0; - array_index < hmi_result_strings.size(); - ++array_index) { + for (size_t array_index = 0; array_index < hmi_result_strings.size(); + ++array_index) { enum_value = static_cast<HmiResults::eType>(array_index); enum_from_string_value = MessageHelper::HMIResultFromString(hmi_result_strings[array_index]); @@ -592,33 +633,29 @@ TEST_F(MessageHelperTest, EXPECT_EQ(enum_value, enum_from_string_value); } -TEST_F(MessageHelperTest, - HMIResultToString_ETypeValueOfEnum_CorrectString) { +TEST_F(MessageHelperTest, HMIResultToString_ETypeValueOfEnum_CorrectString) { std::string string_from_enum; HmiResults::eType casted_enum; // Check all results >=0 - for (size_t array_index = 0; - array_index < hmi_result_strings.size(); - ++array_index) { + for (size_t array_index = 0; array_index < hmi_result_strings.size(); + ++array_index) { casted_enum = static_cast<HmiResults::eType>(array_index); string_from_enum = MessageHelper::HMIResultToString(casted_enum); EXPECT_EQ(hmi_result_strings[array_index], string_from_enum); } // Check InvalidEnum == -1 - string_from_enum = MessageHelper::HMIResultToString( - HmiResults::INVALID_ENUM); + string_from_enum = MessageHelper::HMIResultToString(HmiResults::INVALID_ENUM); EXPECT_EQ("", string_from_enum); } TEST_F(MessageHelperTest, - HMIToMobileResult_HmiResultEType_GetCorrectMobileResultEType) { + HMIToMobileResult_HmiResultEType_GetCorrectMobileResultEType) { MobileResults::eType tested_enum; HmiResults::eType casted_hmi_enum; MobileResults::eType converted_enum; // Check enums >=0 - for (size_t enum_index = 0; - enum_index < hmi_result_strings.size(); - ++enum_index) { + for (size_t enum_index = 0; enum_index < hmi_result_strings.size(); + ++enum_index) { tested_enum = MessageHelper::MobileResultFromString(hmi_result_strings[enum_index]); casted_hmi_enum = static_cast<HmiResults::eType>(enum_index); @@ -636,70 +673,66 @@ TEST_F(MessageHelperTest, } TEST_F(MessageHelperTest, VerifySoftButtonString_WrongStrings_False) { - const StringArray wrong_strings { - "soft_button1\t\ntext", - "soft_button1\\ntext", - "soft_button1\\ttext", - " ", - "soft_button1\t\n", - "soft_button1\\n", - "soft_button1\\t" - }; + const StringArray wrong_strings{"soft_button1\t\ntext", + "soft_button1\\ntext", + "soft_button1\\ttext", + " ", + "soft_button1\t\n", + "soft_button1\\n", + "soft_button1\\t"}; for (size_t i = 0; i < wrong_strings.size(); ++i) { EXPECT_FALSE(MessageHelper::VerifySoftButtonString(wrong_strings[i])); } } TEST_F(MessageHelperTest, VerifySoftButtonString_CorrectStrings_True) { - const StringArray wrong_strings { - "soft_button1.text", - "soft_button1?text", - " asd asdasd .././/", - "soft_button1??....asd", - "soft_button12313fcvzxc./.," - }; + const StringArray wrong_strings{"soft_button1.text", + "soft_button1?text", + " asd asdasd .././/", + "soft_button1??....asd", + "soft_button12313fcvzxc./.,"}; for (size_t i = 0; i < wrong_strings.size(); ++i) { EXPECT_TRUE(MessageHelper::VerifySoftButtonString(wrong_strings[i])); } } TEST_F(MessageHelperTest, - GetIVISubscriptionRequests_ValidApplication_HmiRequestNotEmpty) { + GetIVISubscriptionRequests_ValidApplication_HmiRequestNotEmpty) { // Creating sharedPtr to MockApplication MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>(); // Creating data acessor application_manager::VehicleInfoSubscriptions vis; - DataAccessor<application_manager::VehicleInfoSubscriptions> - data_accessor(vis, true); + DataAccessor<application_manager::VehicleInfoSubscriptions> data_accessor( + vis, true); // Calls for ApplicationManager - EXPECT_CALL(*appSharedMock, app_id() ) - .WillOnce(Return(1u)); - EXPECT_CALL(*appSharedMock, SubscribedIVI()) - .WillOnce(Return(data_accessor)); + EXPECT_CALL(*appSharedMock, app_id()).WillOnce(Return(1u)); + EXPECT_CALL(*appSharedMock, SubscribedIVI()).WillOnce(Return(data_accessor)); smart_objects::SmartObjectList outList = - MessageHelper::GetIVISubscriptionRequests(appSharedMock, mock_application_manager); + MessageHelper::GetIVISubscriptionRequests(appSharedMock, + mock_application_manager); // Expect not empty request EXPECT_FALSE(outList.empty()); } TEST_F(MessageHelperTest, - ProcessSoftButtons_SmartObjectWithoutButtonsKey_Success) { + ProcessSoftButtons_SmartObjectWithoutButtonsKey_Success) { // Creating sharedPtr to MockApplication MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>(); // Creating input data for method smart_objects::SmartObject object; policy_handler_test::MockPolicySettings policy_settings_; - const policy::PolicyHandler policy_handler (policy_settings_, mock_application_manager); + const policy::PolicyHandler policy_handler(policy_settings_, + mock_application_manager); // Method call - mobile_apis::Result::eType result = - MessageHelper::ProcessSoftButtons(object, appSharedMock, policy_handler, mock_application_manager); + mobile_apis::Result::eType result = MessageHelper::ProcessSoftButtons( + object, appSharedMock, policy_handler, mock_application_manager); // Expect EXPECT_EQ(mobile_apis::Result::SUCCESS, result); } TEST_F(MessageHelperTest, - ProcessSoftButtons_IncorectSoftButonValue_InvalidData) { + ProcessSoftButtons_IncorectSoftButonValue_InvalidData) { // Creating sharedPtr to MockApplication MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>(); // Creating input data for method @@ -708,30 +741,29 @@ TEST_F(MessageHelperTest, // Setting invalid image string to button buttons[0][strings::image][strings::value] = "invalid\\nvalue"; policy_handler_test::MockPolicySettings policy_settings_; - const policy::PolicyHandler policy_handler (policy_settings_, mock_application_manager); + const policy::PolicyHandler policy_handler(policy_settings_, + mock_application_manager); // Method call - mobile_apis::Result::eType result = - MessageHelper::ProcessSoftButtons(object, appSharedMock, policy_handler, mock_application_manager); + mobile_apis::Result::eType result = MessageHelper::ProcessSoftButtons( + object, appSharedMock, policy_handler, mock_application_manager); // Expect EXPECT_EQ(mobile_apis::Result::INVALID_DATA, result); } -TEST_F(MessageHelperTest, - VerifyImage_ImageTypeIsStatic_Success) { +TEST_F(MessageHelperTest, VerifyImage_ImageTypeIsStatic_Success) { // Creating sharedPtr to MockApplication MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>(); // Creating input data for method smart_objects::SmartObject image; image[strings::image_type] = mobile_apis::ImageType::STATIC; // Method call - mobile_apis::Result::eType result = - MessageHelper::VerifyImage(image, appSharedMock, mock_application_manager); + mobile_apis::Result::eType result = MessageHelper::VerifyImage( + image, appSharedMock, mock_application_manager); // EXPECT EXPECT_EQ(mobile_apis::Result::SUCCESS, result); } -TEST_F(MessageHelperTest, - VerifyImage_ImageValueNotValid_InvalidData) { +TEST_F(MessageHelperTest, VerifyImage_ImageValueNotValid_InvalidData) { // Creating sharedPtr to MockApplication MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>(); // Creating input data for method @@ -740,15 +772,13 @@ TEST_F(MessageHelperTest, // Invalid value image[strings::value] = " "; // Method call - mobile_apis::Result::eType result = - MessageHelper::VerifyImage(image, appSharedMock, mock_application_manager); + mobile_apis::Result::eType result = MessageHelper::VerifyImage( + image, appSharedMock, mock_application_manager); // EXPECT EXPECT_EQ(mobile_apis::Result::INVALID_DATA, result); } - -TEST_F(MessageHelperTest, - VerifyImageFiles_SmartObjectWithValidData_Success) { +TEST_F(MessageHelperTest, VerifyImageFiles_SmartObjectWithValidData_Success) { // Creating sharedPtr to MockApplication MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>(); // Creating input data for method @@ -756,14 +786,14 @@ TEST_F(MessageHelperTest, images[0][strings::image_type] = mobile_apis::ImageType::STATIC; images[1][strings::image_type] = mobile_apis::ImageType::STATIC; // Method call - mobile_apis::Result::eType result = - MessageHelper::VerifyImageFiles(images, appSharedMock, mock_application_manager); + mobile_apis::Result::eType result = MessageHelper::VerifyImageFiles( + images, appSharedMock, mock_application_manager); // EXPECT EXPECT_EQ(mobile_apis::Result::SUCCESS, result); } TEST_F(MessageHelperTest, - VerifyImageFiles_SmartObjectWithInvalidData_NotSuccsess) { + VerifyImageFiles_SmartObjectWithInvalidData_NotSuccsess) { // Creating sharedPtr to MockApplication MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>(); // Creating input data for method @@ -774,14 +804,14 @@ TEST_F(MessageHelperTest, images[0][strings::value] = " "; images[1][strings::value] = "image\\n"; // Method call - mobile_apis::Result::eType result = - MessageHelper::VerifyImageFiles(images, appSharedMock, mock_application_manager); + mobile_apis::Result::eType result = MessageHelper::VerifyImageFiles( + images, appSharedMock, mock_application_manager); // EXPECT EXPECT_EQ(mobile_apis::Result::INVALID_DATA, result); } TEST_F(MessageHelperTest, - VerifyImageVrHelpItems_SmartObjectWithSeveralValidImages_Succsess) { + VerifyImageVrHelpItems_SmartObjectWithSeveralValidImages_Succsess) { // Creating sharedPtr to MockApplication MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>(); // Creating input data for method @@ -791,14 +821,14 @@ TEST_F(MessageHelperTest, message[1][strings::image][strings::image_type] = mobile_apis::ImageType::STATIC; // Method call - mobile_apis::Result::eType result = - MessageHelper::VerifyImageVrHelpItems(message, appSharedMock, mock_application_manager); + mobile_apis::Result::eType result = MessageHelper::VerifyImageVrHelpItems( + message, appSharedMock, mock_application_manager); // EXPECT EXPECT_EQ(mobile_apis::Result::SUCCESS, result); } TEST_F(MessageHelperTest, - VerifyImageVrHelpItems_SmartObjWithSeveralInvalidImages_NotSuccsess) { + VerifyImageVrHelpItems_SmartObjWithSeveralInvalidImages_NotSuccsess) { // Creating sharedPtr to MockApplication MockApplicationSharedPtr appSharedMock = utils::MakeShared<AppMock>(); // Creating input data for method @@ -811,14 +841,14 @@ TEST_F(MessageHelperTest, message[0][strings::image][strings::value] = " "; message[1][strings::image][strings::value] = "image\\n"; // Method call - mobile_apis::Result::eType result = - MessageHelper::VerifyImageVrHelpItems(message, appSharedMock, mock_application_manager); + mobile_apis::Result::eType result = MessageHelper::VerifyImageVrHelpItems( + message, appSharedMock, mock_application_manager); // EXPECT EXPECT_EQ(mobile_apis::Result::INVALID_DATA, result); } TEST_F(MessageHelperTest, - StringifiedFunctionID_FinctionId_EqualsWithStringsInArray) { + StringifiedFunctionID_FinctionId_EqualsWithStringsInArray) { // Start from 1 because 1 == RESERVED and haven`t ID in last 2 characters // if FUNCTION ID == 1 inner DCHECK is false mobile_apis::FunctionID::eType casted_enum; @@ -830,8 +860,8 @@ TEST_F(MessageHelperTest, } // EventIDs emum strarts from delta_from_functions_id = 32768 for (size_t i = delta_from_functions_id; - i < events_id_strings.size() + delta_from_functions_id; - ++i) { + i < events_id_strings.size() + delta_from_functions_id; + ++i) { casted_enum = static_cast<mobile_apis::FunctionID::eType>(i); converted = MessageHelper::StringifiedFunctionID(casted_enum); EXPECT_EQ(events_id_strings[i - delta_from_functions_id], converted); @@ -839,7 +869,7 @@ TEST_F(MessageHelperTest, } TEST_F(MessageHelperTest, - StringifiedHmiLevel_LevelEnum_EqualsWithStringsInArray) { + StringifiedHmiLevel_LevelEnum_EqualsWithStringsInArray) { mobile_apis::HMILevel::eType casted_enum; std::string converted_value; for (size_t i = 0; i < hmi_level_strings.size(); ++i) { @@ -849,8 +879,7 @@ TEST_F(MessageHelperTest, } } -TEST_F(MessageHelperTest, - StringToHmiLevel_LevelString_EqEType) { +TEST_F(MessageHelperTest, StringToHmiLevel_LevelString_EqEType) { mobile_apis::HMILevel::eType tested_enum; mobile_apis::HMILevel::eType converted_enum; for (size_t i = 0; i < hmi_level_strings.size(); ++i) { @@ -860,8 +889,7 @@ TEST_F(MessageHelperTest, } } -TEST_F(MessageHelperTest, - SubscribeApplicationToSoftButton_CallFromApp) { +TEST_F(MessageHelperTest, SubscribeApplicationToSoftButton_CallFromApp) { // Create application mock MockApplicationSharedPtr appSharedPtr = utils::MakeShared<AppMock>(); // Prepare data for method @@ -869,7 +897,7 @@ TEST_F(MessageHelperTest, 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); } diff --git a/src/components/application_manager/test/mock/event_observer_mock.h b/src/components/application_manager/test/mock/event_observer_mock.h index f61d0377bb..3d3d72c5ab 100644 --- a/src/components/application_manager/test/mock/event_observer_mock.h +++ b/src/components/application_manager/test/mock/event_observer_mock.h @@ -41,9 +41,12 @@ namespace test { namespace components { namespace event_engine_test { -class MockEventObserver : public application_manager::event_engine::EventObserver { +class MockEventObserver + : public application_manager::event_engine::EventObserver { public: - MockEventObserver(::application_manager::event_engine::EventDispatcher& event_dispatcher): application_manager::event_engine::EventObserver(event_dispatcher){} + MockEventObserver( + ::application_manager::event_engine::EventDispatcher& event_dispatcher) + : application_manager::event_engine::EventObserver(event_dispatcher) {} MOCK_METHOD1(on_event, void(const application_manager::event_engine::Event& event)); }; @@ -52,5 +55,4 @@ class MockEventObserver : public application_manager::event_engine::EventObserve } // namespace components } // namespace test -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_MOCK_EVENT_OBSERVER_MOCK_H_ - +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_TEST_MOCK_EVENT_OBSERVER_MOCK_H_ diff --git a/src/components/application_manager/test/mock/include/application_manager/application_manager_impl.h b/src/components/application_manager/test/mock/include/application_manager/application_manager_impl.h index 88b9faedf6..c2879ad721 100644 --- a/src/components/application_manager/test/mock/include/application_manager/application_manager_impl.h +++ b/src/components/application_manager/test/mock/include/application_manager/application_manager_impl.h @@ -166,8 +166,9 @@ class ApplicationManagerImpl std::cout << "ApplicationManagerImpl Mock created \n"; } - MOCK_METHOD2(Init, bool(resumption::LastState& last_state, - media_manager::MediaManager* media_manager)); + MOCK_METHOD2(Init, + bool(resumption::LastState& last_state, + media_manager::MediaManager* media_manager)); MOCK_METHOD0(Stop, bool()); // ApplicationManager methods @@ -219,7 +220,8 @@ class ApplicationManagerImpl // // ApplicationManager methods // MOCK_METHOD1(set_hmi_message_handler, // void(hmi_message_handler::HMIMessageHandler*)); -// MOCK_METHOD1(set_protocol_handler, void(protocol_handler::ProtocolHandler*)); +// MOCK_METHOD1(set_protocol_handler, +// void(protocol_handler::ProtocolHandler*)); // MOCK_METHOD1(set_connection_handler, // void(connection_handler::ConnectionHandler*)); // MOCK_CONST_METHOD0(connection_handler, @@ -236,15 +238,17 @@ class ApplicationManagerImpl const utils::SharedPtr<smart_objects::SmartObject>&)); MOCK_METHOD0(hmi_capabilities, HMICapabilities&()); MOCK_METHOD0(is_attenuated_supported, bool()); - MOCK_METHOD1(ManageHMICommand, - bool(const application_manager::commands::MessageSharedPtr message)); + MOCK_METHOD1( + ManageHMICommand, + bool(const application_manager::commands::MessageSharedPtr message)); MOCK_METHOD2(ManageMobileCommand, bool(const smart_objects::SmartObjectSPtr message, commands::Command::CommandOrigin)); MOCK_METHOD1(SendMessageToHMI, void(const application_manager::commands::MessageSharedPtr)); MOCK_METHOD2(SendMessageToMobile, - void(const application_manager::commands::MessageSharedPtr, bool)); + void(const application_manager::commands::MessageSharedPtr, + bool)); MOCK_METHOD1(SendMessageToMobile, void(const application_manager::commands::MessageSharedPtr)); MOCK_METHOD1(GetDeviceName, std::string(connection_handler::DeviceHandle)); @@ -310,7 +314,8 @@ class ApplicationManagerImpl MOCK_METHOD2(HMILevelAllowsStreaming, bool(uint32_t, protocol_handler::ServiceType)); - MOCK_CONST_METHOD2(CanAppStream, bool(uint32_t, protocol_handler::ServiceType)); + MOCK_CONST_METHOD2(CanAppStream, + bool(uint32_t, protocol_handler::ServiceType)); MOCK_METHOD1(EndNaviServices, void(int32_t)); MOCK_METHOD1(ForbidStreaming, void(uint32_t)); MOCK_METHOD3(OnAppStreaming, @@ -405,7 +410,8 @@ class ApplicationManagerImpl */ class ApplicationListAccessor : public DataAccessor<ApplicationSet> { public: - ApplicationListAccessor(const application_manager::ApplicationManagerImpl& app_man) + ApplicationListAccessor( + const application_manager::ApplicationManagerImpl& app_man) : DataAccessor<ApplicationSet>(ApplicationSet(), sync_primitives::Lock()) {} MOCK_CONST_METHOD0(applications, const ApplicationSet()); @@ -418,7 +424,7 @@ class ApplicationManagerImpl friend class ApplicationListAccessor; -private: + private: FRIEND_BASE_SINGLETON_CLASS(ApplicationManagerImpl); }; diff --git a/src/components/application_manager/test/mock_message_helper.cc b/src/components/application_manager/test/mock_message_helper.cc index 66e9f6cdc8..c53927d3a4 100644 --- a/src/components/application_manager/test/mock_message_helper.cc +++ b/src/components/application_manager/test/mock_message_helper.cc @@ -121,16 +121,18 @@ smart_objects::SmartObjectSPtr CreateDeviceListSO( } void MessageHelper::SendOnAppPermissionsChangedNotification( - uint32_t connection_key, const policy::AppPermissions& permissions, + uint32_t connection_key, + const policy::AppPermissions& permissions, ApplicationManager& app_mngr) { MockMessageHelper::message_helper_mock() - ->SendOnAppPermissionsChangedNotification(connection_key, permissions, - app_mngr); + ->SendOnAppPermissionsChangedNotification( + connection_key, permissions, app_mngr); } void MessageHelper::SendGetUserFriendlyMessageResponse( const std::vector<policy::UserFriendlyMessage>& msg, - uint32_t correlation_id, ApplicationManager& app_mngr) { + uint32_t correlation_id, + ApplicationManager& app_mngr) { MockMessageHelper::message_helper_mock()->SendGetUserFriendlyMessageResponse( msg, correlation_id, app_mngr); } @@ -153,7 +155,8 @@ void MessageHelper::SendGetSystemInfoRequest(ApplicationManager& app_mngr) { } void MessageHelper::CreateGetVehicleDataRequest( - uint32_t correlation_id, const std::vector<std::string>& params, + uint32_t correlation_id, + const std::vector<std::string>& params, ApplicationManager& app_mngr) { MockMessageHelper::message_helper_mock()->CreateGetVehicleDataRequest( correlation_id, params, app_mngr); @@ -161,13 +164,15 @@ void MessageHelper::CreateGetVehicleDataRequest( void MessageHelper::SendGetListOfPermissionsResponse( const std::vector<policy::FunctionalGroupPermission>& permissions, - uint32_t correlation_id, ApplicationManager& app_mngr) { + uint32_t correlation_id, + ApplicationManager& app_mngr) { MockMessageHelper::message_helper_mock()->SendGetListOfPermissionsResponse( permissions, correlation_id, app_mngr); } void MessageHelper::SendOnPermissionsChangeNotification( - uint32_t connection_key, const policy::Permissions& permissions, + uint32_t connection_key, + const policy::Permissions& permissions, ApplicationManager& app_mngr) { MockMessageHelper::message_helper_mock()->SendOnPermissionsChangeNotification( connection_key, permissions, app_mngr); @@ -183,17 +188,19 @@ void MessageHelper::SendPolicySnapshotNotification( } void MessageHelper::SendSDLActivateAppResponse( - policy::AppPermissions& permissions, uint32_t correlation_id, + policy::AppPermissions& permissions, + uint32_t correlation_id, ApplicationManager& app_mngr) { MockMessageHelper::message_helper_mock()->SendSDLActivateAppResponse( permissions, correlation_id, app_mngr); } -void MessageHelper::SendPolicyUpdate(const std::string& file_path, int timeout, +void MessageHelper::SendPolicyUpdate(const std::string& file_path, + int timeout, const std::vector<int>& retries, ApplicationManager& app_mngr) { - MockMessageHelper::message_helper_mock()->SendPolicyUpdate(file_path, timeout, - retries, app_mngr); + MockMessageHelper::message_helper_mock()->SendPolicyUpdate( + file_path, timeout, retries, app_mngr); } void MessageHelper::SendUpdateSDLResponse(const std::string& result, @@ -203,9 +210,10 @@ void MessageHelper::SendUpdateSDLResponse(const std::string& result, result, correlation_id, app_mngr); } -hmi_apis::Common_Language::eType MessageHelper::CommonLanguageFromString(const std::string& language) { - return MockMessageHelper::message_helper_mock()->CommonLanguageFromString( - language); +hmi_apis::Common_Language::eType MessageHelper::CommonLanguageFromString( + const std::string& language) { + return MockMessageHelper::message_helper_mock()->CommonLanguageFromString( + language); } smart_objects::SmartObjectSPtr MessageHelper::CreateModuleInfoSO( @@ -262,7 +270,8 @@ smart_objects::SmartObjectList MessageHelper::GetIVISubscriptionRequests( } mobile_apis::Result::eType MessageHelper::VerifyImageFiles( - smart_objects::SmartObject& message, ApplicationConstSharedPtr app, + smart_objects::SmartObject& message, + ApplicationConstSharedPtr app, ApplicationManager& app_mngr) { return MockMessageHelper::message_helper_mock()->VerifyImageFiles( message, app, app_mngr); @@ -276,10 +285,15 @@ 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, + 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, + session_observer, + policy_handler, + level, + send_policy_priority, app_mngr); } 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 c58f903c57..25b54453e5 100644 --- a/src/components/application_manager/test/policy_event_observer_test.cc +++ b/src/components/application_manager/test/policy_event_observer_test.cc @@ -52,9 +52,7 @@ using ::testing::Return; class PolicyEventObserverTest : public ::testing::Test { public: PolicyEventObserverTest() - : policy_event_observer_(NULL), - event_(NULL), - field_name("odometer") {} + : policy_event_observer_(NULL), event_(NULL), field_name("odometer") {} protected: MockPolicyHandlerInterface policy_handler_mock_; @@ -66,8 +64,8 @@ class PolicyEventObserverTest : public ::testing::Test { const int field_value = 100; virtual void SetUp() OVERRIDE { - policy_event_observer_ = new PolicyEventObserver(&policy_handler_mock_, - mock_event_dispatcher_); + policy_event_observer_ = + new PolicyEventObserver(&policy_handler_mock_, mock_event_dispatcher_); } void TearDown() OVERRIDE { @@ -89,14 +87,17 @@ class PolicyEventObserverTest : public ::testing::Test { void CheckResultsOnEvent(uint32_t pt_updated_calls_number, uint32_t on_system_ready_calls_number) { event_->set_smart_object(smart_object_); - EXPECT_CALL(policy_handler_mock_, PTUpdatedAt(Counters::KILOMETERS, field_value)) + EXPECT_CALL(policy_handler_mock_, + PTUpdatedAt(Counters::KILOMETERS, field_value)) .Times(pt_updated_calls_number); EXPECT_CALL(policy_handler_mock_, OnSystemReady()) .Times(on_system_ready_calls_number); policy_event_observer_->on_event(*event_); } - void DeleteEvent() { delete event_; } + void DeleteEvent() { + delete event_; + } }; TEST_F(PolicyEventObserverTest, OnEvent_EventInvalid_ExpectNoProcessingEvent) { @@ -110,8 +111,8 @@ TEST_F(PolicyEventObserverTest, OnEvent_EventInvalidCommonResult_ExpectNoProcessingEvent) { // Arrange CreateEvent(Event::EventID::VehicleInfo_GetVehicleData); - CookSmartObject(hmi_apis::Common_Result::INVALID_DATA, field_name, - field_value); + CookSmartObject( + hmi_apis::Common_Result::INVALID_DATA, field_name, field_value); // Check CheckResultsOnEvent(0u, 0u); } diff --git a/src/components/application_manager/test/policy_handler_test.cc b/src/components/application_manager/test/policy_handler_test.cc index aa338f9000..33805befc2 100644 --- a/src/components/application_manager/test/policy_handler_test.cc +++ b/src/components/application_manager/test/policy_handler_test.cc @@ -57,7 +57,7 @@ #include "policy/usage_statistics/statistics_manager.h" #include "interfaces/MOBILE_API.h" #include "policy/mock_policy_settings.h" -#include "utils/make_shared.h" +#include "utils/make_shared.h" #include "application_manager/mock_application.h" #include "policy/usage_statistics/mock_statistics_manager.h" #include "protocol_handler/mock_session_observer.h" @@ -81,16 +81,16 @@ using ::testing::NiceMock; class PolicyHandlerTest : public ::testing::Test { public: PolicyHandlerTest() - : policy_handler_(policy_settings_, app_manager_), - app_id_("fake_app_id"), - mac_addr("mac_address"), - device_id_("fake_device_id"), - hmi_level_("default"), - rpc_("fake_rpc"), - priority_("fake_priority"), - default_hmi_("fake_hmi") - ,kPreloadPTFile_("sdl_preloaded_pt.json") - ,kAppStorageFolder_("storage") {} + : policy_handler_(policy_settings_, app_manager_) + , app_id_("fake_app_id") + , mac_addr("mac_address") + , device_id_("fake_device_id") + , hmi_level_("default") + , rpc_("fake_rpc") + , priority_("fake_priority") + , default_hmi_("fake_hmi") + , kPreloadPTFile_("sdl_preloaded_pt.json") + , kAppStorageFolder_("storage") {} protected: NiceMock<MockPolicySettings> policy_settings_; @@ -108,10 +108,10 @@ class PolicyHandlerTest : public ::testing::Test { const std::string kPreloadPTFile_; const std::string kAppStorageFolder_; - virtual void SetUp() OVERRIDE { ON_CALL(policy_settings_, enable_policy()).WillByDefault(Return(true)); - ON_CALL(app_manager_, event_dispatcher()).WillByDefault(ReturnRef(mock_event_dispatcher_)); + ON_CALL(app_manager_, event_dispatcher()) + .WillByDefault(ReturnRef(mock_event_dispatcher_)); std::string path = file_system::CreateDirectory("storage"); file_system::CreateFile(path + "/" + "certificate"); pm_ = utils::MakeShared<policy_manager_test::MockPolicyManager>(); @@ -119,15 +119,19 @@ class PolicyHandlerTest : public ::testing::Test { } void TearDown() OVERRIDE { - ON_CALL(mock_event_dispatcher_, remove_observer(_,_)); + ON_CALL(mock_event_dispatcher_, remove_observer(_, _)); } - void ChangePolicyManagerToMock() { policy_handler_.SetPolicyManager(pm_); } + void ChangePolicyManagerToMock() { + policy_handler_.SetPolicyManager(pm_); + } void EnablePolicy() { ON_CALL(policy_settings_, enable_policy()).WillByDefault(Return(true)); - ON_CALL(policy_settings_, preloaded_pt_file()).WillByDefault(ReturnRef(kPreloadPTFile_)); - ON_CALL(policy_settings_, app_storage_folder()).WillByDefault(ReturnRef(kAppStorageFolder_)); + ON_CALL(policy_settings_, preloaded_pt_file()) + .WillByDefault(ReturnRef(kPreloadPTFile_)); + ON_CALL(policy_settings_, app_storage_folder()) + .WillByDefault(ReturnRef(kAppStorageFolder_)); } void EnablePolicyAndPolicyManagerMock() { @@ -194,8 +198,6 @@ TEST_F(PolicyHandlerTest, ResetPolicyTable_ExpectCallPMResetPT) { policy_handler_.ResetPolicyTable(); } - - TEST_F(PolicyHandlerTest, Test_ClearUserConsent_method) { EnablePolicyAndPolicyManagerMock(); EXPECT_CALL(*pm_, ResetUserConsent()); @@ -278,7 +280,8 @@ TEST_F(PolicyHandlerTest, Test_CheckPermissions_method) { // Check expectations EXPECT_CALL(*pm_, CheckPermissions(app_id_, hmi_level_, rpc_, rpc_params, _)); // Act - policy_handler_.CheckPermissions(app_id_, hmi_level_, rpc_, rpc_params, result); + policy_handler_.CheckPermissions( + app_id_, hmi_level_, rpc_, rpc_params, result); } TEST_F(PolicyHandlerTest, Test_GetNotificationsNumber_method) { @@ -461,13 +464,16 @@ TEST_F(PolicyHandlerTest, Test_OnActivateApp_method) { const uint32_t correlation_id = 2; utils::SharedPtr<application_manager_test::MockApplication> application1 = - utils::MakeShared<application_manager_test::MockApplication>(); + utils::MakeShared<application_manager_test::MockApplication>(); - connection_handler_test::MockConnectionHandlerSettings mock_connection_handler_settings; + connection_handler_test::MockConnectionHandlerSettings + mock_connection_handler_settings; transport_manager_test::MockTransportManager mock_transport_manager; connection_handler::ConnectionHandlerImpl* conn_handler = - new connection_handler::ConnectionHandlerImpl(mock_connection_handler_settings,mock_transport_manager); - EXPECT_CALL(app_manager_,connection_handler()).WillOnce(ReturnRef(*conn_handler)); + new connection_handler::ConnectionHandlerImpl( + mock_connection_handler_settings, mock_transport_manager); + EXPECT_CALL(app_manager_, connection_handler()) + .WillOnce(ReturnRef(*conn_handler)); EXPECT_CALL(app_manager_, application(connection_key)) .Times(1) .WillRepeatedly(Return(application1)); @@ -508,13 +514,14 @@ TEST_F(PolicyHandlerTest, Test_OnPendingPermissionChange_method) { const std::string policy_app_id("mobile_app_id"); utils::SharedPtr<application_manager_test::MockApplication> application = - utils::MakeShared<application_manager_test::MockApplication>(); + utils::MakeShared<application_manager_test::MockApplication>(); EXPECT_CALL(app_manager_, application_by_policy_id(policy_app_id)) .WillOnce(Return(application)); EXPECT_CALL(*application, app_id()).WillOnce(Return(app_id)); - EXPECT_CALL(*application, hmi_level()).WillOnce(Return(mobile_apis::HMILevel::HMI_FULL)); + EXPECT_CALL(*application, hmi_level()) + .WillOnce(Return(mobile_apis::HMILevel::HMI_FULL)); AppPermissions permissions(policy_app_id); EXPECT_CALL(*pm_, GetAppPermissionsChanges(_)).WillOnce(Return(permissions)); EXPECT_CALL(*pm_, RemovePendingPermissionChanges(policy_app_id)).Times(0); @@ -567,7 +574,8 @@ TEST_F(PolicyHandlerTest, Test_OnGetUserFriendlyMessage_method) { EXPECT_CALL(*MockMessageHelper::message_helper_mock(), SendGetUserFriendlyMessageResponse(_, _, _)); // Act - policy_handler_.OnGetUserFriendlyMessage(message_codes, language, correlation_id); + policy_handler_.OnGetUserFriendlyMessage( + message_codes, language, correlation_id); } TEST_F(PolicyHandlerTest, Test_OnGetStatusUpdate_method) { @@ -598,16 +606,17 @@ TEST_F(PolicyHandlerTest, Test_OnCurrentDeviceIdUpdateRequired_method) { std::string policy_app_id("mobile_app_id"); connection_handler_test::MockConnectionHandler conn_handler; utils::SharedPtr<application_manager_test::MockApplication> application = - utils::MakeShared<application_manager_test::MockApplication>(); + utils::MakeShared<application_manager_test::MockApplication>(); EXPECT_CALL(app_manager_, application_by_policy_id(policy_app_id)) .WillOnce(Return(application)); - EXPECT_CALL(app_manager_,connection_handler()).WillOnce(ReturnRef(conn_handler)); + EXPECT_CALL(app_manager_, connection_handler()) + .WillOnce(ReturnRef(conn_handler)); protocol_handler_test::MockSessionObserver session_observer; - EXPECT_CALL(conn_handler,get_session_observer()).WillOnce(ReturnRef(session_observer)); - - EXPECT_CALL(session_observer,GetDataOnDeviceID(0u,_,_,_,_)); + EXPECT_CALL(conn_handler, get_session_observer()) + .WillOnce(ReturnRef(session_observer)); + EXPECT_CALL(session_observer, GetDataOnDeviceID(0u, _, _, _, _)); // Act policy_handler_.OnCurrentDeviceIdUpdateRequired(policy_app_id); @@ -694,10 +703,13 @@ TEST_F(PolicyHandlerTest, Test_RemoveDevice_method) { // Arrange EnablePolicyAndPolicyManagerMock(); // Check expectations - connection_handler_test::MockConnectionHandlerSettings mock_connection_handler_settings; + connection_handler_test::MockConnectionHandlerSettings + mock_connection_handler_settings; transport_manager_test::MockTransportManager mock_transport_manager; connection_handler::ConnectionHandlerImpl* conn_handler = - new connection_handler::ConnectionHandlerImpl(mock_connection_handler_settings,mock_transport_manager);; + new connection_handler::ConnectionHandlerImpl( + mock_connection_handler_settings, mock_transport_manager); + ; EXPECT_CALL(app_manager_, connection_handler()) .WillOnce(ReturnRef(*conn_handler)); EXPECT_CALL(*pm_, MarkUnpairedDevice(device_id_)); @@ -713,7 +725,7 @@ TEST_F(PolicyHandlerTest, Test_GetAppName_method) { CustomString app_name("my_mobile_app"); utils::SharedPtr<application_manager_test::MockApplication> application = - utils::MakeShared<application_manager_test::MockApplication>(); + utils::MakeShared<application_manager_test::MockApplication>(); EXPECT_CALL(*application, name()).WillOnce(ReturnRef(app_name)); EXPECT_CALL(app_manager_, application_by_policy_id(policy_app_id)) @@ -782,7 +794,7 @@ TEST_F(PolicyHandlerTest, Test_SendOnAppPermissionsChanged_method) { std::string policy_app_id("mobile_app_id"); utils::SharedPtr<application_manager_test::MockApplication> application = - utils::MakeShared<application_manager_test::MockApplication>(); + utils::MakeShared<application_manager_test::MockApplication>(); // Check expectations EXPECT_CALL(app_manager_, application_by_policy_id(policy_app_id)) .WillOnce(Return(application)); @@ -798,7 +810,8 @@ TEST_F(PolicyHandlerTest, Test_OnPTExchangeNeeded_method) { EnablePolicyAndPolicyManagerMock(); // Check expectations EXPECT_CALL(*pm_, ForcePTExchange()); - EXPECT_CALL(*MockMessageHelper::message_helper_mock(), SendOnStatusUpdate(_, _)); + EXPECT_CALL(*MockMessageHelper::message_helper_mock(), + SendOnStatusUpdate(_, _)); // Act policy_handler_.OnPTExchangeNeeded(); } 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 e249f6de18..6d08e5bf56 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 @@ -64,7 +64,8 @@ typedef utils::SharedPtr<RequestController> RequestControllerSPtr; class RequestControllerTestClass : public ::testing::Test { public: RequestControllerTestClass() - : request_ctrl_(utils::MakeShared<RequestController>(mock_request_controller_settings_)) { + : request_ctrl_(utils::MakeShared<RequestController>( + mock_request_controller_settings_)) { register_request_ = GetMockRequest(); } @@ -125,14 +126,16 @@ class RequestControllerTestClass : public ::testing::Test { TEST_F(RequestControllerTestClass, CheckPosibilitytoAdd_HMI_FULL_SUCCESS) { CallSettings(); EXPECT_EQ(RequestController::TResult::SUCCESS, - AddRequest(RequestInfo::RequestType::MobileRequest, true, + AddRequest(RequestInfo::RequestType::MobileRequest, + true, mobile_apis::HMILevel::HMI_FULL)); } TEST_F(RequestControllerTestClass, CheckPosibilitytoAdd_HMI_NONE_SUCCESS) { CallSettings(); EXPECT_EQ(RequestController::TResult::SUCCESS, - AddRequest(RequestInfo::RequestType::MobileRequest, true, + AddRequest(RequestInfo::RequestType::MobileRequest, + true, mobile_apis::HMILevel::HMI_NONE)); } @@ -171,13 +174,13 @@ TEST_F(RequestControllerTestClass, ZeroValuePendingRequestsAmount) { const uint32_t big_count_of_requests_for_test_ = 10; for (uint32_t i = 0; i < big_count_of_requests_for_test_; ++i) { CallSettings(); - EXPECT_EQ(RequestController::SUCCESS, AddRequest(RequestInfo::RequestType::MobileRequest, - true, - mobile_apis::HMILevel::HMI_FULL)); + EXPECT_EQ(RequestController::SUCCESS, + AddRequest(RequestInfo::RequestType::MobileRequest, + true, + mobile_apis::HMILevel::HMI_FULL)); } } - } // namespace request_controller } // namespace components } // namespace test diff --git a/src/components/application_manager/test/resumption/include/resumption_data_mock.h b/src/components/application_manager/test/resumption/include/resumption_data_mock.h index af481c3f89..2bf4cef6c0 100644 --- a/src/components/application_manager/test/resumption/include/resumption_data_mock.h +++ b/src/components/application_manager/test/resumption/include/resumption_data_mock.h @@ -46,23 +46,26 @@ namespace smart_objects = NsSmartDeviceLink::NsSmartObjects; class MockResumptionData : public ::resumption::ResumptionData { public: - MockResumptionData(const application_manager_test::MockApplicationManager& application_manager): - ResumptionData(application_manager) {} + MockResumptionData(const application_manager_test::MockApplicationManager& + application_manager) + : ResumptionData(application_manager) {} MOCK_METHOD1(SaveApplication, void(app_mngr::ApplicationSharedPtr application)); MOCK_CONST_METHOD2(GetStoredHMILevel, int32_t(const std::string& policy_app_id, const std::string& device_id)); MOCK_CONST_METHOD1(IsHMIApplicationIdExist, bool(uint32_t hmi_app_id)); - MOCK_METHOD2(CheckSavedApplication, bool(const std::string& policy_app_id, - const std::string& device_id)); + MOCK_METHOD2(CheckSavedApplication, + bool(const std::string& policy_app_id, + const std::string& device_id)); MOCK_CONST_METHOD2(GetHMIApplicationID, uint32_t(const std::string& policy_app_id, const std::string& device_id)); MOCK_METHOD0(OnSuspend, void()); MOCK_CONST_METHOD3(GetHashId, bool(const std::string& policy_app_id, - const std::string& device_id, std::string& hash_id)); + const std::string& device_id, + std::string& hash_id)); MOCK_METHOD0(OnAwake, void()); MOCK_CONST_METHOD3(GetSavedApplication, bool(const std::string& policy_app_id, @@ -77,9 +80,10 @@ class MockResumptionData : public ::resumption::ResumptionData { const std::string& device_id)); MOCK_CONST_METHOD1(GetDataForLoadResumeData, void(smart_objects::SmartObject& saved_data)); - MOCK_METHOD3(UpdateHmiLevel, void(const std::string& policy_app_id, - const std::string& device_id, - mobile_apis::HMILevel::eType hmi_level)); + MOCK_METHOD3(UpdateHmiLevel, + void(const std::string& policy_app_id, + const std::string& device_id, + mobile_apis::HMILevel::eType hmi_level)); MOCK_METHOD0(Init, bool()); MOCK_METHOD2(DropAppDataResumption, bool(const std::string& device_id, const std::string& app_id)); 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 d3dbd16c69..797d4c3c8d 100644 --- a/src/components/application_manager/test/resumption/resume_ctrl_test.cc +++ b/src/components/application_manager/test/resumption/resume_ctrl_test.cc @@ -69,9 +69,11 @@ using namespace mobile_apis::HMILevel; class ResumeCtrlTest : public ::testing::Test { protected: virtual void SetUp() OVERRIDE { - ON_CALL(app_mngr_, event_dispatcher()).WillByDefault(ReturnRef(mock_event_dispatcher_)); + ON_CALL(app_mngr_, event_dispatcher()) + .WillByDefault(ReturnRef(mock_event_dispatcher_)); mock_storage = - ::utils::MakeShared<NiceMock<resumption_test::MockResumptionData> >(mock_application_manager_settings_); + ::utils::MakeShared<NiceMock<resumption_test::MockResumptionData>>( + mock_application_manager_settings_); app_mock = utils::MakeShared<NiceMock<MockApplication>>(); res_ctrl = utils::MakeShared<ResumeCtrl>(app_mngr_); res_ctrl->set_resumption_storage(mock_storage); @@ -82,13 +84,13 @@ class ResumeCtrlTest : public ::testing::Test { mac_address = "12345"; test_grammar_id = 10; hash = "saved_hash"; - ON_CALL(app_mngr_,get_settings()). - WillByDefault(ReturnRef(mock_application_manager_settings_)); + ON_CALL(app_mngr_, get_settings()) + .WillByDefault(ReturnRef(mock_application_manager_settings_)); - ON_CALL(mock_application_manager_settings_, use_db_for_resumption()). - WillByDefault(Return(false)); - ON_CALL(mock_application_manager_settings_, app_resuming_timeout()). - WillByDefault(ReturnRef(kAppResumingTimeout)); + ON_CALL(mock_application_manager_settings_, use_db_for_resumption()) + .WillByDefault(Return(false)); + ON_CALL(mock_application_manager_settings_, app_resuming_timeout()) + .WillByDefault(ReturnRef(kAppResumingTimeout)); } void GetInfoFromApp() { ON_CALL(*app_mock, policy_app_id()) @@ -96,21 +98,21 @@ class ResumeCtrlTest : public ::testing::Test { ON_CALL(*app_mock, mac_address()).WillByDefault(ReturnRef(mac_address)); ON_CALL(*app_mock, device()).WillByDefault(Return(test_dev_id)); ON_CALL(*app_mock, app_id()).WillByDefault(Return(test_app_id)); - } NiceMock<event_engine_test::MockEventDispatcher> mock_event_dispatcher_; - application_manager_test::MockApplicationManagerSettings mock_application_manager_settings_; + application_manager_test::MockApplicationManagerSettings + mock_application_manager_settings_; application_manager_test::MockApplicationManager app_mngr_; utils::SharedPtr<ResumeCtrl> res_ctrl; - utils::SharedPtr<NiceMock<resumption_test::MockResumptionData> > mock_storage; + utils::SharedPtr<NiceMock<resumption_test::MockResumptionData>> mock_storage; utils::SharedPtr<NiceMock<MockApplication>> app_mock; // app_mock.app_id() will return this value uint32_t test_app_id; std::string test_policy_app_id; std::string mac_address; mobile_apis::HMILevel::eType default_test_type; - const uint32_t cor_id=10; + const uint32_t cor_id = 10; // app_mock.Device() will return this value uint32_t test_dev_id; uint32_t test_grammar_id; @@ -245,9 +247,11 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithSubmenues) { } smart_objects::SmartObjectList requests; - EXPECT_CALL(app_mngr_, GetNextHMICorrelationID()).WillRepeatedly(Return(cor_id)); + EXPECT_CALL(app_mngr_, GetNextHMICorrelationID()) + .WillRepeatedly(Return(cor_id)); EXPECT_CALL(*application_manager::MockMessageHelper::message_helper_mock(), - CreateAddSubMenuRequestToHMI(_,cor_id)).WillRepeatedly(Return(requests)); + CreateAddSubMenuRequestToHMI(_, cor_id)) + .WillRepeatedly(Return(requests)); EXPECT_CALL(*app_mock, UpdateHash()); bool res = res_ctrl->StartResumption(app_mock, hash); @@ -284,7 +288,8 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithCommands) { smart_objects::SmartObjectList requests; EXPECT_CALL(*application_manager::MockMessageHelper::message_helper_mock(), - CreateAddCommandRequestToHMI(_,_)).WillRepeatedly(Return(requests)); + CreateAddCommandRequestToHMI(_, _)) + .WillRepeatedly(Return(requests)); bool res = res_ctrl->StartResumption(app_mock, hash); EXPECT_TRUE(res); @@ -402,7 +407,7 @@ TEST_F(ResumeCtrlTest, StartResumption_AppWithSubscribeOnButtons) { EXPECT_CALL(*app_mock, UpdateHash()); EXPECT_CALL(*application_manager::MockMessageHelper::message_helper_mock(), - SendAllOnButtonSubscriptionNotificationsForApp(_,_)).Times(2); + SendAllOnButtonSubscriptionNotificationsForApp(_, _)).Times(2); bool res = res_ctrl->StartResumption(app_mock, hash); EXPECT_TRUE(res); @@ -470,7 +475,8 @@ TEST_F(ResumeCtrlTest, StartAppHmiStateResumption_AppInFull) { saved_app[application_manager::strings::hmi_level] = restored_test_type; MockStateController state_controller_; - EXPECT_CALL(app_mngr_, state_controller()).WillOnce(ReturnRef(state_controller_)); + EXPECT_CALL(app_mngr_, state_controller()) + .WillOnce(ReturnRef(state_controller_)); EXPECT_CALL(state_controller_, SetRegularState(_, restored_test_type)) .Times(AtLeast(1)); GetInfoFromApp(); @@ -515,7 +521,8 @@ TEST_F(ResumeCtrlTest, RestoreAppHMIState_RestoreHMILevelFull) { saved_app[application_manager::strings::hmi_level] = restored_test_type; MockStateController state_controller_; - EXPECT_CALL(app_mngr_, state_controller()).WillOnce(ReturnRef(state_controller_)); + EXPECT_CALL(app_mngr_, state_controller()) + .WillOnce(ReturnRef(state_controller_)); EXPECT_CALL(state_controller_, SetRegularState(_, restored_test_type)) .Times(AtLeast(1)); GetInfoFromApp(); @@ -544,7 +551,8 @@ TEST_F(ResumeCtrlTest, SetupDefaultHMILevel) { .WillOnce(Return(default_test_type)); MockStateController state_controller_; - EXPECT_CALL(app_mngr_, state_controller()).WillOnce(ReturnRef(state_controller_)); + EXPECT_CALL(app_mngr_, state_controller()) + .WillOnce(ReturnRef(state_controller_)); EXPECT_CALL(state_controller_, SetRegularState(_, default_test_type)) .Times(AtLeast(1)); @@ -562,7 +570,8 @@ TEST_F(ResumeCtrlTest, SetAppHMIState_HMINone_WithoutCheckPolicy) { EXPECT_CALL(*app_mock, set_is_resuming(true)); MockStateController state_controller_; - EXPECT_CALL(app_mngr_, state_controller()).WillOnce(ReturnRef(state_controller_)); + EXPECT_CALL(app_mngr_, state_controller()) + .WillOnce(ReturnRef(state_controller_)); EXPECT_CALL(state_controller_, SetRegularState(_, default_test_type)) .Times(AtLeast(1)); bool res = res_ctrl->SetAppHMIState(app_mock, default_test_type, false); @@ -576,7 +585,8 @@ TEST_F(ResumeCtrlTest, SetAppHMIState_HMILimited_WithoutCheckPolicy) { EXPECT_CALL(*app_mock, set_is_resuming(true)); MockStateController state_controller_; - EXPECT_CALL(app_mngr_, state_controller()).WillOnce(ReturnRef(state_controller_)); + EXPECT_CALL(app_mngr_, state_controller()) + .WillOnce(ReturnRef(state_controller_)); EXPECT_CALL(state_controller_, SetRegularState(_, test_type)) .Times(AtLeast(1)); bool res = res_ctrl->SetAppHMIState(app_mock, test_type, false); @@ -592,7 +602,8 @@ TEST_F(ResumeCtrlTest, SetAppHMIState_HMIFull_WithoutCheckPolicy) { EXPECT_CALL(*app_mock, set_is_resuming(true)); MockStateController state_controller_; - EXPECT_CALL(app_mngr_, state_controller()).WillOnce(ReturnRef(state_controller_)); + EXPECT_CALL(app_mngr_, state_controller()) + .WillOnce(ReturnRef(state_controller_)); EXPECT_CALL(state_controller_, SetRegularState(_, test_type)) .Times(AtLeast(1)); @@ -609,7 +620,8 @@ TEST_F(ResumeCtrlTest, SetAppHMIState_HMIFull_WithPolicy_DevAllowed) { EXPECT_CALL(*app_mock, set_is_resuming(true)); MockStateController state_controller_; - EXPECT_CALL(app_mngr_, state_controller()).WillOnce(ReturnRef(state_controller_)); + EXPECT_CALL(app_mngr_, state_controller()) + .WillOnce(ReturnRef(state_controller_)); EXPECT_CALL(state_controller_, SetRegularState(_, test_type)) .Times(AtLeast(1)); @@ -626,7 +638,8 @@ TEST_F(ResumeCtrlTest, SetAppHMIState_HMIFull_WithPolicy_DevDisallowed) { EXPECT_CALL(*app_mock, set_is_resuming(true)); MockStateController state_controller_; - EXPECT_CALL(app_mngr_, state_controller()).WillOnce(ReturnRef(state_controller_)); + EXPECT_CALL(app_mngr_, state_controller()) + .WillOnce(ReturnRef(state_controller_)); EXPECT_CALL(app_mngr_, GetDefaultHmiLevel(_)) .WillOnce(Return(default_test_type)); EXPECT_CALL(state_controller_, SetRegularState(_, default_test_type)) @@ -751,7 +764,9 @@ TEST_F(ResumeCtrlTest, DISABLED_OnSuspend) { TEST_F(ResumeCtrlTest, OnAwake) { uint32_t timeout = 10u; - EXPECT_CALL(mock_application_manager_settings_, app_resumption_save_persistent_data_timeout()).WillOnce(ReturnRef(timeout)); + EXPECT_CALL(mock_application_manager_settings_, + app_resumption_save_persistent_data_timeout()) + .WillOnce(ReturnRef(timeout)); EXPECT_CALL(*mock_storage, OnAwake()); res_ctrl->OnAwake(); } 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 df4adb53ad..4363f533b4 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 @@ -42,7 +42,6 @@ #include "application_manager/test_resumption_data_db.h" #include "resumption_data_test.h" - #include "application_manager/resumption/resumption_sql_queries.h" #include "application_manager/resumption/resumption_data_db.h" @@ -84,7 +83,8 @@ class ResumptionDataDBTest : public ResumptionDataTest { kDatabaseName = "resumption"; path_ = "test_storage"; CreateDirectory("./" + path_); - ON_CALL(mock_application_manager_settings_, app_storage_folder()).WillByDefault(ReturnRef(path_)); + ON_CALL(mock_application_manager_settings_, app_storage_folder()) + .WillByDefault(ReturnRef(path_)); test_db_ = new utils::dbms::SQLDatabase(kDatabaseName); test_db_->set_path(path_ + "/"); res_db_ = new TestResumptionDataDB(mock_application_manager_settings_); @@ -114,11 +114,11 @@ class ResumptionDataDBTest : public ResumptionDataTest { } void SetZeroIgnOffTime() { - utils::dbms::SQLQuery query(test_db()); - EXPECT_TRUE(query.Prepare(KUpdateLastIgnOffTime)); - query.Bind(0, 0); - EXPECT_TRUE(query.Exec()); - } + utils::dbms::SQLQuery query(test_db()); + EXPECT_TRUE(query.Prepare(KUpdateLastIgnOffTime)); + query.Bind(0, 0); + EXPECT_TRUE(query.Exec()); + } static TestResumptionDataDB* res_db_; 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 5a5346e17f..ef79586b27 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 @@ -64,9 +64,9 @@ namespace Formatters = NsSmartDeviceLink::NsJSONHandler::Formatters; class ResumptionDataJsonTest : public ResumptionDataTest { protected: - ResumptionDataJsonTest() : last_state_("app_storage_folder", - "app_info_storage"), res_json(last_state_, - mock_application_manager_settings_) {} + ResumptionDataJsonTest() + : last_state_("app_storage_folder", "app_info_storage") + , res_json(last_state_, mock_application_manager_settings_) {} virtual void SetUp() { app_mock = new NiceMock<application_manager_test::MockApplication>(); @@ -105,7 +105,8 @@ class ResumptionDataJsonTest : public ResumptionDataTest { resumption::LastState last_state_; ResumptionDataJson res_json; - application_manager_test::MockApplicationManagerSettings mock_application_manager_settings_; + application_manager_test::MockApplicationManagerSettings + mock_application_manager_settings_; std::string policy_app_id_; }; 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 06ecff8d7a..91c18ea1fc 100644 --- a/src/components/application_manager/test/resumption/resumption_data_test.cc +++ b/src/components/application_manager/test/resumption/resumption_data_test.cc @@ -78,9 +78,9 @@ void ResumptionDataTest::CheckSavedApp(sm::SmartObject& resume_app_list) { void ResumptionDataTest::CheckCommands(sm::SmartObject& res_list) { for (uint32_t i = 0; i < count_of_commands; ++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()); @@ -92,8 +92,7 @@ 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()); @@ -152,24 +151,20 @@ 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 = @@ -187,15 +182,13 @@ 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/resumption_data_test.h b/src/components/application_manager/test/resumption/resumption_data_test.h index bea28b1e1e..3714abd767 100755..100644 --- a/src/components/application_manager/test/resumption/resumption_data_test.h +++ b/src/components/application_manager/test/resumption/resumption_data_test.h @@ -57,15 +57,17 @@ using namespace resumption; using namespace mobile_apis; class ResumptionDataTest : public ::testing::Test { - public : - ResumptionDataTest() :tts_chunks_count(4) {} + public: + ResumptionDataTest() : tts_chunks_count(4) {} + protected: // Check structure in saved application void CheckSavedApp(sm::SmartObject& saved_data); // Set data for resumption virtual void PrepareData(); - utils::SharedPtr<NiceMock<application_manager_test::MockApplication>> app_mock; + utils::SharedPtr<NiceMock<application_manager_test::MockApplication>> + app_mock; profile::Profile profile_; HMILevel::eType hmi_level_; 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 1136651d11..08fa0a3eb5 100644 --- a/src/components/application_manager/test/resumption_sql_queries_test.cc +++ b/src/components/application_manager/test/resumption_sql_queries_test.cc @@ -128,20 +128,28 @@ class ResumptionSqlQueriesTest : public ::testing::Test { string file_to_delete = kDatabaseName + ".sqlite"; file_system::DeleteFile(file_to_delete); } - void TearDown() OVERRIDE { DeleteTablesData(); } + void TearDown() OVERRIDE { + DeleteTablesData(); + } - void CheckDeleteQuery(const string& count_query, const string& query_to_check, - pair<int, string> app_info, pair<int, string> dev_info, - const int value_before, const int value_after, + void CheckDeleteQuery(const string& count_query, + const string& query_to_check, + pair<int, string> app_info, + pair<int, string> dev_info, + const int value_before, + const int value_after, const int position_in_result); - void CheckSelectQuery(const string& query_to_check, const int control_value, + void CheckSelectQuery(const string& query_to_check, + const int control_value, const int position_in_result); - void CheckSelectQuery(const string& query_to_check, const char* control_value, + void CheckSelectQuery(const string& query_to_check, + const char* control_value, const int position_in_result); - void CheckSelectQuery(const string& query_to_check, const bool control_value, + void CheckSelectQuery(const string& query_to_check, + const bool control_value, const int position_in_result); void CheckSelectQuery(const string& query_to_check, @@ -149,11 +157,14 @@ class ResumptionSqlQueriesTest : public ::testing::Test { const int position_in_result); void CheckSelectQuery(const string& query_to_check, - pair<int, string> app_info, pair<int, string> dev_info, - const int control_value, const int position_in_result); + pair<int, string> app_info, + pair<int, string> dev_info, + const int control_value, + const int position_in_result); void CheckSelectQuery(const string& query_to_check, - pair<int, string> app_info, pair<int, string> dev_info, + pair<int, string> app_info, + pair<int, string> dev_info, const string& control_value, const int position_in_result); @@ -163,20 +174,30 @@ class ResumptionSqlQueriesTest : public ::testing::Test { return ss.str(); } - SQLQuery& FillGlobalPropertiesTable( - SQLQuery& query, const string& vrHelpTitle, const string& menuTitle, - const int language, const int keyboardLayout, const int keypressMode, - const string& autoCompleteText, const int64_t image_key); - - SQLQuery& FillApplicationTable(SQLQuery& query, const int connection_key, - const int grammarID, const string& hashID, - const int hmiAppID, const int hmiLevel, - const int ign_off_count, const int timeStamp, - bool isMediaApplication, const string& appID, + SQLQuery& FillGlobalPropertiesTable(SQLQuery& query, + const string& vrHelpTitle, + const string& menuTitle, + const int language, + const int keyboardLayout, + const int keypressMode, + const string& autoCompleteText, + const int64_t image_key); + + SQLQuery& FillApplicationTable(SQLQuery& query, + const int connection_key, + const int grammarID, + const string& hashID, + const int hmiAppID, + const int hmiLevel, + const int ign_off_count, + const int timeStamp, + bool isMediaApplication, + const string& appID, const string& deviceID, const int64_t glob_prop_key); - SQLQuery& FillImageTable(SQLQuery& query, const int imageType, + SQLQuery& FillImageTable(SQLQuery& query, + const int imageType, const string& value); SQLQuery& FillTableLimitedCharacterListTable( @@ -186,7 +207,8 @@ class ResumptionSqlQueriesTest : public ::testing::Test { const int64_t glob_prop_key, const int64_t lim_char_list_key); - SQLQuery& FillTTSChunkTable(SQLQuery& query, const int type, + SQLQuery& FillTTSChunkTable(SQLQuery& query, + const int type, const string& text); SQLQuery& FillHelpTimeoutPromptArrayTable(SQLQuery& query, @@ -194,18 +216,23 @@ class ResumptionSqlQueriesTest : public ::testing::Test { const int64_t tts_chunk_key, const int idhelpPrompt); - SQLQuery& FillFileTable(SQLQuery& query, const int fileType, - bool is_download_complete, bool persistentFile, + SQLQuery& FillFileTable(SQLQuery& query, + const int fileType, + bool is_download_complete, + bool persistentFile, const string& syncFileName); SQLQuery& FillApplicationFilesArrayTable(SQLQuery& query, const int64_t app_key, const int64_t file_key); - SQLQuery& FillSubMenuTable(SQLQuery& query, const int menuID, - const string& menuName, const int position); + SQLQuery& FillSubMenuTable(SQLQuery& query, + const int menuID, + const string& menuName, + const int position); - SQLQuery& FillApplicationSubMenuArrayTable(SQLQuery& query, const int app_key, + SQLQuery& FillApplicationSubMenuArrayTable(SQLQuery& query, + const int app_key, const int sub_menu_key); SQLQuery& FillAppSubscriptionsArrayTable(SQLQuery& query, @@ -213,16 +240,21 @@ class ResumptionSqlQueriesTest : public ::testing::Test { const int ButtonNameValue, const int app_key); - SQLQuery& FillCommandTable(SQLQuery& query, const int cmdID, - const string& menuName, const int parentID, - const int position, const int64_t image_key); + SQLQuery& FillCommandTable(SQLQuery& query, + const int cmdID, + const string& menuName, + const int parentID, + const int position, + const int64_t image_key); SQLQuery& FillApplicationCommandsArrayTable(SQLQuery& query, const int64_t application_key, const int64_t command_key); - SQLQuery& FillChoiceTable(SQLQuery& query, const int choiceID, - const string& menuName, const string& secondaryText, + SQLQuery& FillChoiceTable(SQLQuery& query, + const int choiceID, + const string& menuName, + const string& secondaryText, const string& tertiaryText, const int64_t image_key); @@ -230,19 +262,23 @@ class ResumptionSqlQueriesTest : public ::testing::Test { const int64_t app_choice_set_key, const int64_t choice_key); - SQLQuery& FillApplicationChoiceSetTable(SQLQuery& query, const int grammarID, + SQLQuery& FillApplicationChoiceSetTable(SQLQuery& query, + const int grammarID, const int interactionChoiceSetID); SQLQuery& FillApplicationChoiceSetArrayTable(SQLQuery& query, const int64_t app_choice_set_key, const int64_t app_key); - SQLQuery& FillVRCommandsArrayTable(SQLQuery& query, const string& vrCommand, + SQLQuery& FillVRCommandsArrayTable(SQLQuery& query, + const string& vrCommand, AccessoryVRCommand value, const int64_t foreing_key); - SQLQuery& FillVRHelpItemTable(SQLQuery& query, const string& text, - const int position, const int64_t image_key); + SQLQuery& FillVRHelpItemTable(SQLQuery& query, + const string& text, + const int position, + const int64_t image_key); SQLQuery& FillVRHelpItemArrayTable(SQLQuery& query, const int64_t global_prop_key, @@ -263,7 +299,9 @@ class ResumptionSqlQueriesTest : public ::testing::Test { EXPECT_TRUE(query.Exec(kDeleteData)); } - SQLDatabase* db() const { return db_; } + SQLDatabase* db() const { + return db_; + } void db_schema_fill() { db_schema.push_back("resumption"); @@ -436,7 +474,8 @@ SQLQuery& ResumptionSqlQueriesTest::FillTableLimitedCharacterListTable( } SQLQuery& ResumptionSqlQueriesTest::FillCharacterArrayTable( - SQLQuery& query, const int64_t glob_prop_key, + SQLQuery& query, + const int64_t glob_prop_key, const int64_t lim_char_list_key) { EXPECT_TRUE(query.Prepare(kInsertCharacterArray)); query.Bind(0, glob_prop_key); @@ -456,7 +495,9 @@ SQLQuery& ResumptionSqlQueriesTest::FillTTSChunkTable(SQLQuery& query, } SQLQuery& ResumptionSqlQueriesTest::FillHelpTimeoutPromptArrayTable( - SQLQuery& query, int64_t glob_prop_key, int64_t tts_chunk_key, + SQLQuery& query, + int64_t glob_prop_key, + int64_t tts_chunk_key, const int idhelpPrompt) { EXPECT_TRUE(query.Prepare(kInsertHelpTimeoutPromptArray)); query.Bind(0, glob_prop_key); @@ -467,10 +508,18 @@ SQLQuery& ResumptionSqlQueriesTest::FillHelpTimeoutPromptArrayTable( } SQLQuery& ResumptionSqlQueriesTest::FillApplicationTable( - SQLQuery& query, const int connection_key, const int grammarID, - const string& hashID, const int hmiAppID, const int hmiLevel, - const int ign_off_count, const int timeStamp, bool isMediaApplication, - const string& appID, const string& deviceID, const int64_t glob_prop_key) { + SQLQuery& query, + const int connection_key, + const int grammarID, + const string& hashID, + const int hmiAppID, + const int hmiLevel, + const int ign_off_count, + const int timeStamp, + bool isMediaApplication, + const string& appID, + const string& deviceID, + const int64_t glob_prop_key) { EXPECT_TRUE(query.Prepare(kInsertApplication)); query.Bind(0, connection_key); query.Bind(1, grammarID); @@ -488,9 +537,14 @@ SQLQuery& ResumptionSqlQueriesTest::FillApplicationTable( } SQLQuery& ResumptionSqlQueriesTest::FillGlobalPropertiesTable( - SQLQuery& query, const string& vrHelpTitle, const string& menuTitle, - const int language, const int keyboardLayout, const int keypressMode, - const string& autoCompleteText, const int64_t image_key) { + SQLQuery& query, + const string& vrHelpTitle, + const string& menuTitle, + const int language, + const int keyboardLayout, + const int keypressMode, + const string& autoCompleteText, + const int64_t image_key) { EXPECT_TRUE(query.Prepare(kInsertGlobalProperties)); query.Bind(0, vrHelpTitle); query.Bind(1, menuTitle); @@ -512,9 +566,12 @@ SQLQuery& ResumptionSqlQueriesTest::FillApplicationCommandsArrayTable( return query; } -SQLQuery& ResumptionSqlQueriesTest::FillCommandTable( - SQLQuery& query, const int cmdID, const string& menuName, - const int parentID, const int position, const int64_t image_key) { +SQLQuery& ResumptionSqlQueriesTest::FillCommandTable(SQLQuery& query, + const int cmdID, + const string& menuName, + const int parentID, + const int position, + const int64_t image_key) { EXPECT_TRUE(query.Prepare(kInsertToCommand)); query.Bind(0, cmdID); query.Bind(1, image_key); @@ -543,7 +600,8 @@ SQLQuery& ResumptionSqlQueriesTest::FillChoiceTable(SQLQuery& query, } SQLQuery& ResumptionSqlQueriesTest::FillChoiceArrayTable( - SQLQuery& query, const int64_t app_choice_set_key, + SQLQuery& query, + const int64_t app_choice_set_key, const int64_t choice_key) { EXPECT_TRUE(query.Prepare(kInsertChoiceArray)); query.Bind(0, app_choice_set_key); @@ -571,7 +629,9 @@ SQLQuery& ResumptionSqlQueriesTest::FillApplicationChoiceSetArrayTable( } SQLQuery& ResumptionSqlQueriesTest::FillVRCommandsArrayTable( - SQLQuery& query, const string& vrCommand, AccessoryVRCommand value, + SQLQuery& query, + const string& vrCommand, + AccessoryVRCommand value, const int64_t foreing_key) { EXPECT_TRUE(query.Prepare(kInsertVrCommand)); query.Bind(0, vrCommand); @@ -587,7 +647,9 @@ SQLQuery& ResumptionSqlQueriesTest::FillVRCommandsArrayTable( } SQLQuery& ResumptionSqlQueriesTest::FillVRHelpItemTable( - SQLQuery& query, const string& text, const int position, + SQLQuery& query, + const string& text, + const int position, const int64_t image_key) { EXPECT_TRUE(query.Prepare(kInsertVRHelpItem)); query.Bind(0, text); @@ -598,7 +660,8 @@ SQLQuery& ResumptionSqlQueriesTest::FillVRHelpItemTable( } SQLQuery& ResumptionSqlQueriesTest::FillVRHelpItemArrayTable( - SQLQuery& query, const int64_t global_prop_key, + SQLQuery& query, + const int64_t global_prop_key, const int64_t vr_help_item_key) { EXPECT_TRUE(query.Prepare(kInsertVRHelpItemArray)); query.Bind(0, global_prop_key); @@ -617,7 +680,9 @@ SQLQuery& ResumptionSqlQueriesTest::FillApplicationSubMenuArrayTable( } SQLQuery& ResumptionSqlQueriesTest::FillAppSubscriptionsArrayTable( - SQLQuery& query, const int vehicleValue, const int ButtonNameValue, + SQLQuery& query, + const int vehicleValue, + const int ButtonNameValue, const int app_key) { EXPECT_TRUE(query.Prepare(kInsertSubscriptions)); query.Bind(0, app_key); @@ -738,12 +803,22 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCountHMILevel_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); - key = FillGlobalPropertiesTable(temp_query, "vrHelp", "menuTitle", 1, 1, 2, - "auto", key).LastInsertId(); - - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id1, device_id, key); + key = FillGlobalPropertiesTable( + temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) + .LastInsertId(); + + FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id1, + device_id, + key); ValToPosPair p1(0, device_id); ValToPosPair p2(1, app_id1); @@ -755,11 +830,21 @@ TEST_F(ResumptionSqlQueriesTest, kSelectHMILevel_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); - key = FillGlobalPropertiesTable(temp_query, "vrHelp", "menuTitle", 1, 1, 2, - "auto", key).LastInsertId(); - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id1, device_id, key); + key = FillGlobalPropertiesTable( + temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) + .LastInsertId(); + FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id1, + device_id, + key); ValToPosPair p1(0, device_id); ValToPosPair p2(1, app_id1); // Check @@ -770,11 +855,21 @@ TEST_F(ResumptionSqlQueriesTest, kCheckHMIId_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); - key = FillGlobalPropertiesTable(temp_query, "vrHelp", "menuTitle", 1, 1, 2, - "auto", key).LastInsertId(); - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id1, device_id, key); + key = FillGlobalPropertiesTable( + temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) + .LastInsertId(); + FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id1, + device_id, + key); ValToPosPair p1(0, IntToString(hmiAppID)); ValToPosPair p2(1, ""); // Check @@ -785,11 +880,21 @@ TEST_F(ResumptionSqlQueriesTest, kSelectHMIId_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); - key = FillGlobalPropertiesTable(temp_query, "vrHelp", "menuTitle", 1, 1, 2, - "auto", key).LastInsertId(); - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id1, device_id, key); + key = FillGlobalPropertiesTable( + temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) + .LastInsertId(); + FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id1, + device_id, + key); ValToPosPair p1(0, device_id); ValToPosPair p2(1, app_id1); // Check @@ -800,11 +905,21 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCountHMIId_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); - key = FillGlobalPropertiesTable(temp_query, "vrHelp", "menuTitle", 1, 1, 2, - "auto", key).LastInsertId(); - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id1, device_id, key); + key = FillGlobalPropertiesTable( + temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) + .LastInsertId(); + FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id1, + device_id, + key); ValToPosPair p1(0, device_id); ValToPosPair p2(1, app_id1); @@ -816,11 +931,21 @@ TEST_F(ResumptionSqlQueriesTest, kCountHashId_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); - key = FillGlobalPropertiesTable(temp_query, "vrHelp", "menuTitle", 1, 1, 2, - "auto", key).LastInsertId(); - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id1, device_id, key); + key = FillGlobalPropertiesTable( + temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) + .LastInsertId(); + FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id1, + device_id, + key); ValToPosPair p1(0, device_id); ValToPosPair p2(1, app_id1); @@ -832,11 +957,21 @@ TEST_F(ResumptionSqlQueriesTest, kSelectHashId_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); - key = FillGlobalPropertiesTable(temp_query, "vrHelp", "menuTitle", 1, 1, 2, - "auto", key).LastInsertId(); - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id1, device_id, key); + key = FillGlobalPropertiesTable( + temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) + .LastInsertId(); + FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id1, + device_id, + key); ValToPosPair p1(0, device_id); ValToPosPair p2(1, app_id1); // Check @@ -856,11 +991,21 @@ TEST_F(ResumptionSqlQueriesTest, kCheckApplication_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); - key = FillGlobalPropertiesTable(temp_query, "vrHelp", "menuTitle", 1, 1, 2, - "auto", key).LastInsertId(); - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id1, device_id, key); + key = FillGlobalPropertiesTable( + temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) + .LastInsertId(); + FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id1, + device_id, + key); ValToPosPair p1(0, device_id); ValToPosPair p2(1, app_id1); // Check @@ -871,18 +1016,38 @@ TEST_F(ResumptionSqlQueriesTest, kCountApplications_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); - key = FillGlobalPropertiesTable(temp_query, "vrHelp", "menuTitle", 1, 1, 2, - "auto", key).LastInsertId(); - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id1, device_id, key); + key = FillGlobalPropertiesTable( + temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) + .LastInsertId(); + FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id1, + device_id, + key); key = FillImageTable(temp_query, 1, "tst_img2").LastInsertId(); - key = FillGlobalPropertiesTable(temp_query, "vrHelp", "menuTitle", 1, 1, 2, - "auto", key).LastInsertId(); - FillApplicationTable(temp_query, connection_key, grammarID, test_hash2, - hmiAppID2, hmiLevel2, ign_off_count, timeStamp2, false, - app_id2, device_id, key); + key = FillGlobalPropertiesTable( + temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) + .LastInsertId(); + FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash2, + hmiAppID2, + hmiLevel2, + ign_off_count, + timeStamp2, + false, + app_id2, + device_id, + key); // Check CheckSelectQuery(kCountApplications, 2, 0); } @@ -892,12 +1057,22 @@ TEST_F(ResumptionSqlQueriesTest, // Arrange SQLQuery temp_query(db()); int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); - key = FillGlobalPropertiesTable(temp_query, "vrHelp", "menuTitle", 1, 1, 2, - "auto", key).LastInsertId(); - - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id1, device_id, key); + key = FillGlobalPropertiesTable( + temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) + .LastInsertId(); + + FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id1, + device_id, + key); // Checks CheckSelectQuery(kSelectDataForLoadResumeData, hmiLevel, 0); CheckSelectQuery(kSelectDataForLoadResumeData, ign_off_count, 1); @@ -910,12 +1085,22 @@ TEST_F(ResumptionSqlQueriesTest, kUpdateHMILevel_ExpectDataUpdated) { // Arrange SQLQuery temp_query(db()); int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); - key = FillGlobalPropertiesTable(temp_query, "vrHelp", "menuTitle", 1, 1, 2, - "auto", key).LastInsertId(); - - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id1, device_id, key); + key = FillGlobalPropertiesTable( + temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) + .LastInsertId(); + + FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id1, + device_id, + key); // Act SQLQuery query_update_hmi_level(db()); EXPECT_TRUE(query_update_hmi_level.Prepare(kUpdateHMILevel)); @@ -933,11 +1118,21 @@ TEST_F(ResumptionSqlQueriesTest, kUpdateIgnOffCount_ExpectDataUpdated) { // Arrange SQLQuery temp_query(db()); int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); - key = FillGlobalPropertiesTable(temp_query, "vrHelp", "menuTitle", 1, 1, 2, - "auto", key).LastInsertId(); - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id1, device_id, key); + key = FillGlobalPropertiesTable( + temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) + .LastInsertId(); + FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id1, + device_id, + key); const std::string kSelectIgnOffCount = "SELECT ign_off_count FROM application;"; @@ -954,16 +1149,35 @@ TEST_F(ResumptionSqlQueriesTest, kCountApplicationsIgnOff_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); - key = FillGlobalPropertiesTable(temp_query, "vrHelp", "menuTitle", 1, 1, 2, - "auto", key).LastInsertId(); - - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id1, device_id, key); - - FillApplicationTable(temp_query, connection_key, grammarID, test_hash2, - hmiAppID2, hmiLevel2, ign_off_count2, timeStamp2, false, - app_id2, device_id, key); + key = FillGlobalPropertiesTable( + temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) + .LastInsertId(); + + FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id1, + device_id, + key); + + FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash2, + hmiAppID2, + hmiLevel2, + ign_off_count2, + timeStamp2, + false, + app_id2, + device_id, + key); ValToPosPair p1(0, IntToString(4)); ValToPosPair p2(1, ""); @@ -976,15 +1190,34 @@ TEST_F(ResumptionSqlQueriesTest, // Arrange SQLQuery temp_query(db()); int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); - key = FillGlobalPropertiesTable(temp_query, "vrHelp", "menuTitle", 1, 1, 2, - "auto", key).LastInsertId(); - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id1, device_id, key); - - FillApplicationTable(temp_query, connection_key, grammarID, test_hash2, - hmiAppID2, hmiLevel2, ign_off_count2, timeStamp2, false, - app_id2, device_id, key); + key = FillGlobalPropertiesTable( + temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) + .LastInsertId(); + FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id1, + device_id, + key); + + FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash2, + hmiAppID2, + hmiLevel2, + ign_off_count2, + timeStamp2, + false, + app_id2, + device_id, + key); ValToPosPair p1(0, IntToString(4)); ValToPosPair p2(1, ""); @@ -997,10 +1230,21 @@ TEST_F(ResumptionSqlQueriesTest, kUpdateSuspendData_ExpectDataUpdated) { // Arrange SQLQuery temp_query(db()); int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); - key = FillGlobalPropertiesTable(temp_query, "vrHelp", "menuTitle", 1, 1, 2, - "auto", key).LastInsertId(); - FillApplicationTable(temp_query, 1, 1, test_hash, 111, 1, 3, 45127, false, - app_id1, device_id, key); + key = FillGlobalPropertiesTable( + temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) + .LastInsertId(); + FillApplicationTable(temp_query, + 1, + 1, + test_hash, + 111, + 1, + 3, + 45127, + false, + app_id1, + device_id, + key); // Act SQLQuery query_update_suspend_data(db()); @@ -1015,11 +1259,21 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteFile_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId(); - key1 = FillGlobalPropertiesTable(temp_query, "vrHelp", "menuTitle", 1, 1, 2, - "auto", key1).LastInsertId(); - key1 = FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, - false, app_id2, device_id, key1).LastInsertId(); + key1 = FillGlobalPropertiesTable( + temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1) + .LastInsertId(); + key1 = FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id2, + device_id, + key1).LastInsertId(); int64_t key2 = FillFileTable(temp_query, 1, true, true, "tst_name").LastInsertId(); FillApplicationFilesArrayTable(temp_query, key1, key2); @@ -1035,11 +1289,21 @@ TEST_F(ResumptionSqlQueriesTest, // Arrange SQLQuery temp_query(db()); int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId(); - key1 = FillGlobalPropertiesTable(temp_query, "vrHelp", "menuTitle", 1, 1, 2, - "auto", key1).LastInsertId(); - key1 = FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, - false, app_id2, device_id, key1).LastInsertId(); + key1 = FillGlobalPropertiesTable( + temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1) + .LastInsertId(); + key1 = FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id2, + device_id, + key1).LastInsertId(); int64_t key2 = FillFileTable(temp_query, 1, true, true, "tst_name").LastInsertId(); FillApplicationFilesArrayTable(temp_query, key1, key2); @@ -1049,18 +1313,33 @@ TEST_F(ResumptionSqlQueriesTest, ValToPosPair p1(0, app_id2); ValToPosPair p2(1, device_id); CheckDeleteQuery(select_count_applicationsFilesArray, - kDeleteApplicationFilesArray, p1, p2, 1, 0, 0); + kDeleteApplicationFilesArray, + p1, + p2, + 1, + 0, + 0); } TEST_F(ResumptionSqlQueriesTest, kDeleteSubMenu_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); - key = FillGlobalPropertiesTable(temp_query, "vrHelp", "menuTitle", 1, 1, 2, - "auto", key).LastInsertId(); - key = FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, - false, app_id2, device_id, key).LastInsertId(); + key = FillGlobalPropertiesTable( + temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) + .LastInsertId(); + key = FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id2, + device_id, + key).LastInsertId(); int64_t submenu_key = FillSubMenuTable(temp_query, 1, "tst_menuName", 2).LastInsertId(); @@ -1077,11 +1356,21 @@ TEST_F(ResumptionSqlQueriesTest, // Arrange SQLQuery temp_query(db()); int64_t key = FillImageTable(temp_query, 1, test_image).LastInsertId(); - key = FillGlobalPropertiesTable(temp_query, "vrHelp", "menuTitle", 1, 1, 2, - "auto", key).LastInsertId(); - key = FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, - false, app_id2, device_id, key).LastInsertId(); + key = FillGlobalPropertiesTable( + temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key) + .LastInsertId(); + key = FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id2, + device_id, + key).LastInsertId(); int64_t submenu_key = FillSubMenuTable(temp_query, 1, "tst_menuName", 2).LastInsertId(); @@ -1092,8 +1381,8 @@ TEST_F(ResumptionSqlQueriesTest, "SELECT COUNT(*) FROM applicationSubMenuArray;"; ValToPosPair p1(0, app_id2); ValToPosPair p2(1, device_id); - CheckDeleteQuery(select_count_subMenu, kDeleteApplicationSubMenuArray, p1, p2, - 1, 0, 0); + CheckDeleteQuery( + select_count_subMenu, kDeleteApplicationSubMenuArray, p1, p2, 1, 0, 0); } TEST_F(ResumptionSqlQueriesTest, @@ -1101,11 +1390,21 @@ TEST_F(ResumptionSqlQueriesTest, // Arrange SQLQuery temp_query(db()); int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId(); - key1 = FillGlobalPropertiesTable(temp_query, "vrHelp", "menuTitle", 1, 1, 2, - "auto", key1).LastInsertId(); - key1 = FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, - false, app_id2, device_id, key1).LastInsertId(); + key1 = FillGlobalPropertiesTable( + temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1) + .LastInsertId(); + key1 = FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id2, + device_id, + key1).LastInsertId(); int64_t key2 = FillFileTable(temp_query, 1, true, true, "tst_name").LastInsertId(); key1 = FillApplicationFilesArrayTable(temp_query, key1, key2).LastInsertId(); @@ -1116,7 +1415,12 @@ TEST_F(ResumptionSqlQueriesTest, ValToPosPair p1(0, app_id2); ValToPosPair p2(1, device_id); CheckDeleteQuery(select_count_applicationSubscribtionsArray, - kDeleteApplicationSubscribtionsArray, p1, p2, 1, 0, 0); + kDeleteApplicationSubscribtionsArray, + p1, + p2, + 1, + 0, + 0); } TEST_F(ResumptionSqlQueriesTest, kDeleteImageFromCommands_ExpectDataDeleted) { @@ -1125,18 +1429,28 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteImageFromCommands_ExpectDataDeleted) { int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId(); int64_t key2 = FillCommandTable(temp_query, 1, "tst_menu_name", 1, 2, key1) .LastInsertId(); - key1 = FillGlobalPropertiesTable(temp_query, "vrHelp", "menuTitle", 1, 1, 2, - "auto", key1).LastInsertId(); - key1 = FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, - false, app_id2, device_id, key1).LastInsertId(); + key1 = FillGlobalPropertiesTable( + temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1) + .LastInsertId(); + key1 = FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id2, + device_id, + key1).LastInsertId(); FillApplicationCommandsArrayTable(temp_query, key1, key2); // Check before action const std::string select_count_image = "SELECT COUNT(*) FROM image;"; ValToPosPair p1(0, app_id2); ValToPosPair p2(1, device_id); - CheckDeleteQuery(select_count_image, kDeleteImageFromCommands, p1, p2, 1, 0, - 0); + CheckDeleteQuery( + select_count_image, kDeleteImageFromCommands, p1, p2, 1, 0, 0); } TEST_F(ResumptionSqlQueriesTest, kDeleteVrCommands_ExpectDataDeleted) { @@ -1145,22 +1459,32 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteVrCommands_ExpectDataDeleted) { int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId(); int64_t key2 = FillCommandTable(temp_query, 1, "tst_menu_name", 1, 2, key1) .LastInsertId(); - key1 = FillGlobalPropertiesTable(temp_query, "vrHelp", "menuTitle", 1, 1, 2, - "auto", key1).LastInsertId(); - key1 = FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, - false, app_id2, device_id, key1).LastInsertId(); - - FillVRCommandsArrayTable(temp_query, "tst_vr_command", kVRCommandFromCommand, - key2); + key1 = FillGlobalPropertiesTable( + temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1) + .LastInsertId(); + key1 = FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id2, + device_id, + key1).LastInsertId(); + + FillVRCommandsArrayTable( + temp_query, "tst_vr_command", kVRCommandFromCommand, key2); FillApplicationCommandsArrayTable(temp_query, key1, key2); // Check const std::string select_count_vrCommandsArray = "SELECT COUNT(*) FROM vrCommandsArray;"; ValToPosPair p1(0, app_id2); ValToPosPair p2(1, device_id); - CheckDeleteQuery(select_count_vrCommandsArray, kDeleteVrCommands, p1, p2, 1, - 0, 0); + CheckDeleteQuery( + select_count_vrCommandsArray, kDeleteVrCommands, p1, p2, 1, 0, 0); } TEST_F(ResumptionSqlQueriesTest, kDeleteCommands_ExpectDataDeleted) { @@ -1170,11 +1494,21 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteCommands_ExpectDataDeleted) { int64_t key2 = FillCommandTable(temp_query, 1, "tst_menu_name", 1, 2, key1) .LastInsertId(); - key1 = FillGlobalPropertiesTable(temp_query, "vrHelp", "menuTitle", 1, 1, 2, - "auto", key1).LastInsertId(); - key1 = FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, - false, app_id2, device_id, key1).LastInsertId(); + key1 = FillGlobalPropertiesTable( + temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1) + .LastInsertId(); + key1 = FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id2, + device_id, + key1).LastInsertId(); FillApplicationCommandsArrayTable(temp_query, key1, key2); // Check @@ -1192,11 +1526,21 @@ TEST_F(ResumptionSqlQueriesTest, int64_t key2 = FillCommandTable(temp_query, 1, "tst_menu_name", 1, 2, key1) .LastInsertId(); - key1 = FillGlobalPropertiesTable(temp_query, "vrHelp", "menuTitle", 1, 1, 2, - "auto", key1).LastInsertId(); - key1 = FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, - false, app_id2, device_id, key1).LastInsertId(); + key1 = FillGlobalPropertiesTable( + temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1) + .LastInsertId(); + key1 = FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id2, + device_id, + key1).LastInsertId(); FillApplicationCommandsArrayTable(temp_query, key1, key2); // Check @@ -1205,20 +1549,36 @@ TEST_F(ResumptionSqlQueriesTest, ValToPosPair p1(0, app_id2); ValToPosPair p2(1, device_id); CheckDeleteQuery(select_count_applicationCommandsArray, - kDeleteApplicationCommandsArray, p1, p2, 1, 0, 0); + kDeleteApplicationCommandsArray, + p1, + p2, + 1, + 0, + 0); } TEST_F(ResumptionSqlQueriesTest, kDeleteImageFromChoiceSet_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId(); - int64_t key2 = - FillChoiceTable(temp_query, 2, "tst_menu_name", "secondary_txt", - "tst_tert_text", key1).LastInsertId(); - int64_t key3 = - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id2, device_id, key1).LastInsertId(); + int64_t key2 = FillChoiceTable(temp_query, + 2, + "tst_menu_name", + "secondary_txt", + "tst_tert_text", + key1).LastInsertId(); + int64_t key3 = FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id2, + device_id, + key1).LastInsertId(); int64_t key4 = FillApplicationChoiceSetTable(temp_query, 1, 2).LastInsertId(); FillChoiceArrayTable(temp_query, key4, key2); FillApplicationChoiceSetArrayTable(temp_query, key4, key3); @@ -1227,8 +1587,8 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteImageFromChoiceSet_ExpectDataDeleted) { const std::string select_count_image = "SELECT COUNT(*) FROM image;"; ValToPosPair p1(0, app_id2); ValToPosPair p2(1, device_id); - CheckDeleteQuery(select_count_image, kDeleteImageFromChoiceSet, p1, p2, 1, 0, - 0); + CheckDeleteQuery( + select_count_image, kDeleteImageFromChoiceSet, p1, p2, 1, 0, 0); } TEST_F(ResumptionSqlQueriesTest, @@ -1236,14 +1596,25 @@ TEST_F(ResumptionSqlQueriesTest, // Arrange SQLQuery temp_query(db()); int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId(); - int64_t key2 = FillChoiceTable(temp_query, 1, "tst_menu_name", "second_text", - "tert_txt", key1).LastInsertId(); - key1 = FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, - false, app_id2, device_id, key1).LastInsertId(); - - FillVRCommandsArrayTable(temp_query, "tst_vr_command", kVRCommandFromChoice, - key2); + int64_t key2 = + FillChoiceTable( + temp_query, 1, "tst_menu_name", "second_text", "tert_txt", key1) + .LastInsertId(); + key1 = FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id2, + device_id, + key1).LastInsertId(); + + FillVRCommandsArrayTable( + temp_query, "tst_vr_command", kVRCommandFromChoice, key2); int64_t key3 = FillApplicationChoiceSetTable(temp_query, 1, 2).LastInsertId(); @@ -1255,19 +1626,35 @@ TEST_F(ResumptionSqlQueriesTest, // Check ValToPosPair p1(0, app_id2); ValToPosPair p2(1, device_id); - CheckDeleteQuery(select_count_vrCommandsArray, kDeleteVrCommandsFromChoiceSet, - p1, p2, 1, 0, 0); + CheckDeleteQuery(select_count_vrCommandsArray, + kDeleteVrCommandsFromChoiceSet, + p1, + p2, + 1, + 0, + 0); } TEST_F(ResumptionSqlQueriesTest, kDeleteChoice_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId(); - int64_t key2 = FillChoiceTable(temp_query, 1, "tst_menu_name", "second_text", - "tert_txt", key1).LastInsertId(); - key1 = FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, - false, app_id2, device_id, key1).LastInsertId(); + int64_t key2 = + FillChoiceTable( + temp_query, 1, "tst_menu_name", "second_text", "tert_txt", key1) + .LastInsertId(); + key1 = FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id2, + device_id, + key1).LastInsertId(); int64_t key3 = FillApplicationChoiceSetTable(temp_query, 1, 2).LastInsertId(); FillChoiceArrayTable(temp_query, key3, key2); FillApplicationChoiceSetArrayTable(temp_query, key3, key1); @@ -1283,37 +1670,54 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteChoiceArray_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); int64_t choice_table_key = - FillChoiceTable(temp_query, 1, "tst_menu_name", "second_text", "tert_txt", - 0).LastInsertId(); + FillChoiceTable( + temp_query, 1, "tst_menu_name", "second_text", "tert_txt", 0) + .LastInsertId(); int64_t application_choiceset_table_key = FillApplicationChoiceSetTable(temp_query, 1, 2).LastInsertId(); - int64_t application_table_key = - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id2, device_id, 1).LastInsertId(); + int64_t application_table_key = FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id2, + device_id, + 1).LastInsertId(); FillApplicationChoiceSetArrayTable( temp_query, application_choiceset_table_key, application_table_key); - FillChoiceArrayTable(temp_query, application_choiceset_table_key, - choice_table_key); + FillChoiceArrayTable( + temp_query, application_choiceset_table_key, choice_table_key); // Check const std::string select_count_choice_array = "SELECT COUNT(*) FROM choiceArray;"; ValToPosPair p1(0, app_id2); ValToPosPair p2(1, device_id); - CheckDeleteQuery(select_count_choice_array, kDeleteChoiceArray, p1, p2, 1, 0, - 0); + CheckDeleteQuery( + select_count_choice_array, kDeleteChoiceArray, p1, p2, 1, 0, 0); } TEST_F(ResumptionSqlQueriesTest, kDeleteApplicationChoiceSet_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); - int64_t key1 = - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id2, device_id, 1).LastInsertId(); + int64_t key1 = FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id2, + device_id, + 1).LastInsertId(); int64_t key2 = FillApplicationChoiceSetTable(temp_query, 1, 2).LastInsertId(); FillApplicationChoiceSetArrayTable(temp_query, key2, key1); @@ -1325,17 +1729,30 @@ TEST_F(ResumptionSqlQueriesTest, ValToPosPair p1(0, app_id2); ValToPosPair p2(1, device_id); CheckDeleteQuery(select_count_applicationChoiceSet, - kDeleteApplicationChoiceSet, p1, p2, 1, 0, 0); + kDeleteApplicationChoiceSet, + p1, + p2, + 1, + 0, + 0); } TEST_F(ResumptionSqlQueriesTest, kDeleteApplicationChoiceSetArray_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); - int64_t key1 = - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id2, device_id, 1).LastInsertId(); + int64_t key1 = FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id2, + device_id, + 1).LastInsertId(); int64_t key2 = FillApplicationChoiceSetTable(temp_query, 1, 2).LastInsertId(); FillApplicationChoiceSetArrayTable(temp_query, key2, key1); @@ -1346,7 +1763,12 @@ TEST_F(ResumptionSqlQueriesTest, ValToPosPair p1(0, app_id2); ValToPosPair p2(1, device_id); CheckDeleteQuery(select_count_applicationChoiceSetArray, - kDeleteApplicationChoiceSetArray, p1, p2, 1, 0, 0); + kDeleteApplicationChoiceSetArray, + p1, + p2, + 1, + 0, + 0); } TEST_F(ResumptionSqlQueriesTest, @@ -1354,59 +1776,89 @@ TEST_F(ResumptionSqlQueriesTest, // Arrange SQLQuery temp_query(db()); int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId(); - int64_t key2 = FillGlobalPropertiesTable(temp_query, "vrHelp", "menuTitle", 1, - 1, 2, "auto", key1).LastInsertId(); + int64_t key2 = FillGlobalPropertiesTable( + temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1) + .LastInsertId(); key1 = FillVRHelpItemTable(temp_query, "tst_text", 1, key1).LastInsertId(); FillVRHelpItemArrayTable(temp_query, key2, key1); - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id2, device_id, key2); + FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id2, + device_id, + key2); // Check const std::string select_count_image = "SELECT COUNT(*) FROM image;"; ValToPosPair p1(0, app_id2); ValToPosPair p2(1, device_id); - CheckDeleteQuery(select_count_image, kDeleteImageFromGlobalProperties, p1, p2, - 1, 0, 0); + CheckDeleteQuery( + select_count_image, kDeleteImageFromGlobalProperties, p1, p2, 1, 0, 0); } TEST_F(ResumptionSqlQueriesTest, kDeletevrHelpItem_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId(); - int64_t key2 = FillGlobalPropertiesTable(temp_query, "vrHelp", "menuTitle", 1, - 1, 2, "auto", key1).LastInsertId(); + int64_t key2 = FillGlobalPropertiesTable( + temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1) + .LastInsertId(); key1 = FillVRHelpItemTable(temp_query, "tst_text", 1, key1).LastInsertId(); FillVRHelpItemArrayTable(temp_query, key2, key1); - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id2, device_id, key2); + FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id2, + device_id, + key2); // Check const std::string select_count_vrhelp_item = "SELECT COUNT(*) FROM vrHelpItem;"; ValToPosPair p1(0, app_id2); ValToPosPair p2(1, device_id); - CheckDeleteQuery(select_count_vrhelp_item, kDeletevrHelpItem, p1, p2, 1, 0, - 0); + CheckDeleteQuery( + select_count_vrhelp_item, kDeletevrHelpItem, p1, p2, 1, 0, 0); } TEST_F(ResumptionSqlQueriesTest, kDeletevrHelpItemArray_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); int64_t key1 = FillImageTable(temp_query, 1, test_image).LastInsertId(); - int64_t key2 = FillGlobalPropertiesTable(temp_query, "vrHelp", "menuTitle", 1, - 1, 2, "auto", key1).LastInsertId(); + int64_t key2 = FillGlobalPropertiesTable( + temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", key1) + .LastInsertId(); key1 = FillVRHelpItemTable(temp_query, "tst_text", 1, key1).LastInsertId(); FillVRHelpItemArrayTable(temp_query, key2, key1); - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id2, device_id, key2); + FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id2, + device_id, + key2); // Check const std::string select_count_vrhelp_item_array = "SELECT COUNT(*) FROM vrHelpItemArray;"; ValToPosPair p1(0, app_id2); ValToPosPair p2(1, device_id); - CheckDeleteQuery(select_count_vrhelp_item_array, kDeletevrHelpItemArray, p1, - p2, 1, 0, 0); + CheckDeleteQuery( + select_count_vrhelp_item_array, kDeletevrHelpItemArray, p1, p2, 1, 0, 0); } TEST_F(ResumptionSqlQueriesTest, @@ -1416,11 +1868,21 @@ 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(); - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id1, device_id, key2); + int64_t key2 = + FillGlobalPropertiesTable( + temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", 0).LastInsertId(); + FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id1, + device_id, + key2); FillCharacterArrayTable(temp_query, key2, key1); // Check const std::string select_count_tableLimitedCharacterList = @@ -1428,7 +1890,12 @@ TEST_F(ResumptionSqlQueriesTest, ValToPosPair p1(0, app_id1); ValToPosPair p2(1, device_id); CheckDeleteQuery(select_count_tableLimitedCharacterList, - kDeleteTableLimitedCharacterList, p1, p2, 1, 0, 0); + kDeleteTableLimitedCharacterList, + p1, + p2, + 1, + 0, + 0); } TEST_F(ResumptionSqlQueriesTest, kDeleteCharacterArray_ExpectDataDeleted) { @@ -1437,19 +1904,29 @@ 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(); - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id1, device_id, key2); + int64_t key2 = + FillGlobalPropertiesTable( + temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", 0).LastInsertId(); + FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id1, + device_id, + key2); FillCharacterArrayTable(temp_query, key2, key1); // Check const std::string select_count_characterArray = "SELECT COUNT(*) FROM characterArray;"; ValToPosPair p1(0, app_id1); ValToPosPair p2(1, device_id); - CheckDeleteQuery(select_count_characterArray, kDeleteCharacterArray, p1, p2, - 1, 0, 0); + CheckDeleteQuery( + select_count_characterArray, kDeleteCharacterArray, p1, p2, 1, 0, 0); } TEST_F(ResumptionSqlQueriesTest, kDeleteTTSChunk_ExpectDataDeleted) { @@ -1458,12 +1935,21 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteTTSChunk_ExpectDataDeleted) { int64_t tts_chunk_key = FillTTSChunkTable(temp_query, 1, "tst_text").LastInsertId(); int64_t glob_prop_key = - FillGlobalPropertiesTable(temp_query, "vrHelp", "menuTitle", 1, 1, 2, - "auto", 0).LastInsertId(); - - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id1, device_id, glob_prop_key); + FillGlobalPropertiesTable( + temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", 0).LastInsertId(); + + FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id1, + device_id, + glob_prop_key); FillHelpTimeoutPromptArrayTable(temp_query, glob_prop_key, tts_chunk_key, 1); // Check @@ -1477,16 +1963,25 @@ TEST_F(ResumptionSqlQueriesTest, kDeleteFromApplicationTable_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id1, device_id, 1); + FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id1, + device_id, + 1); // Check const std::string select_count_application = "SELECT COUNT(*) FROM application;"; ValToPosPair p1(0, app_id1); ValToPosPair p2(1, device_id); - CheckDeleteQuery(select_count_application, kDeleteFromApplicationTable, p1, - p2, 1, 0, 0); + CheckDeleteQuery( + select_count_application, kDeleteFromApplicationTable, p1, p2, 1, 0, 0); } TEST_F(ResumptionSqlQueriesTest, @@ -1496,11 +1991,20 @@ TEST_F(ResumptionSqlQueriesTest, int64_t tts_chunk_key = FillTTSChunkTable(temp_query, 1, "tst_text").LastInsertId(); int64_t glob_prop_key = - FillGlobalPropertiesTable(temp_query, "vrHelp", "menuTitle", 1, 1, 2, - "auto", 0).LastInsertId(); - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id1, device_id, glob_prop_key); + FillGlobalPropertiesTable( + temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", 0).LastInsertId(); + FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id1, + device_id, + glob_prop_key); FillHelpTimeoutPromptArrayTable(temp_query, glob_prop_key, tts_chunk_key, 1); // Check @@ -1509,25 +2013,39 @@ TEST_F(ResumptionSqlQueriesTest, ValToPosPair p1(0, app_id1); ValToPosPair p2(1, device_id); CheckDeleteQuery(select_count_helpTimeoutPromptArray, - kDeleteHelpTimeoutPromptArray, p1, p2, 1, 0, 0); + kDeleteHelpTimeoutPromptArray, + p1, + p2, + 1, + 0, + 0); } TEST_F(ResumptionSqlQueriesTest, kDeleteGlobalProperties_ExpectDataDeleted) { // Arrange SQLQuery temp_query(db()); int64_t glob_prop_key = - FillGlobalPropertiesTable(temp_query, "vrHelp", "menuTitle", 1, 1, 2, - "auto", 0).LastInsertId(); - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id1, device_id, glob_prop_key); + FillGlobalPropertiesTable( + temp_query, "vrHelp", "menuTitle", 1, 1, 2, "auto", 0).LastInsertId(); + FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id1, + device_id, + glob_prop_key); // Check const std::string select_count_globalProperties = "SELECT COUNT(*) FROM globalProperties;"; ValToPosPair p1(0, app_id1); ValToPosPair p2(1, device_id); - CheckDeleteQuery(select_count_globalProperties, kDeleteGlobalProperties, p1, - p2, 1, 0, 0); + CheckDeleteQuery( + select_count_globalProperties, kDeleteGlobalProperties, p1, p2, 1, 0, 0); } TEST_F(ResumptionSqlQueriesTest, kSelectCountImage_ExpectDataCorrect) { @@ -1783,8 +2301,8 @@ TEST_F(ResumptionSqlQueriesTest, TEST_F(ResumptionSqlQueriesTest, kInsertGlobalProperties_ExpectDataInserted) { // Arrange SQLQuery temp_query(db()); - FillGlobalPropertiesTable(temp_query, "vr_title", "menu_title", 2, 1, 3, - "auto", 7); + FillGlobalPropertiesTable( + temp_query, "vr_title", "menu_title", 2, 1, 3, "auto", 7); // Checks const std::string select_count_globalProperties = "SELECT COUNT(*) FROM globalProperties;"; @@ -1911,9 +2429,18 @@ TEST_F(ResumptionSqlQueriesTest, kInsertTTSChunk_ExpectDataInserted) { TEST_F(ResumptionSqlQueriesTest, kInsertApplication_ExpectDataInserted) { // Arrange SQLQuery temp_query(db()); - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id1, device_id, 9); + FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id1, + device_id, + 9); // Checks const std::string select_count_application = "SELECT COUNT(*) FROM application;"; @@ -1950,10 +2477,18 @@ TEST_F(ResumptionSqlQueriesTest, kInsertApplication_ExpectDataInserted) { TEST_F(ResumptionSqlQueriesTest, kSelectCountFiles_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t app_key = - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id1, device_id, 9).LastInsertId(); + int64_t app_key = FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id1, + device_id, + 9).LastInsertId(); int64_t file_key = FillFileTable(temp_query, 1, true, true, "tst_name").LastInsertId(); FillApplicationFilesArrayTable(temp_query, app_key, file_key); @@ -1967,10 +2502,18 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCountFiles_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kSelectFiles_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t app_key = - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id1, device_id, 9).LastInsertId(); + int64_t app_key = FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id1, + device_id, + 9).LastInsertId(); int64_t file_key = FillFileTable(temp_query, 1, true, true, "tst_name").LastInsertId(); FillApplicationFilesArrayTable(temp_query, app_key, file_key); @@ -1986,10 +2529,18 @@ TEST_F(ResumptionSqlQueriesTest, kSelectFiles_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kSelectCountSubMenu_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t app_key = - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id1, device_id, 9).LastInsertId(); + int64_t app_key = FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id1, + device_id, + 9).LastInsertId(); int64_t submenu_key = FillSubMenuTable(temp_query, 1, "menu_name", 1).LastInsertId(); FillApplicationSubMenuArrayTable(temp_query, app_key, submenu_key); @@ -2002,10 +2553,18 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCountSubMenu_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kSelectSubMenu_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t app_key = - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id1, device_id, 9).LastInsertId(); + int64_t app_key = FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id1, + device_id, + 9).LastInsertId(); int64_t submenu_key = FillSubMenuTable(temp_query, 1, "menu_name", 1).LastInsertId(); @@ -2021,10 +2580,18 @@ TEST_F(ResumptionSqlQueriesTest, kSelectSubMenu_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kSelectCountCommands_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t app_key = - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id1, device_id, 9).LastInsertId(); + int64_t app_key = FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id1, + device_id, + 9).LastInsertId(); int64_t command_key = FillCommandTable(temp_query, 1, "menu_name", 1, 2, 5).LastInsertId(); FillApplicationCommandsArrayTable(temp_query, app_key, command_key); @@ -2037,20 +2604,30 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCountCommands_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kSelectCommandsFromCommand_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t app_key = - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id1, device_id, 9).LastInsertId(); + int64_t app_key = FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id1, + device_id, + 9).LastInsertId(); int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId(); - FillChoiceTable(temp_query, 1, "menu_name", "sec_text", "tert_text", - image_key).LastInsertId(); - int64_t command_key = FillCommandTable(temp_query, 1, "menu_name", 1, 2, - image_key).LastInsertId(); + FillChoiceTable( + temp_query, 1, "menu_name", "sec_text", "tert_text", image_key) + .LastInsertId(); + int64_t command_key = + FillCommandTable(temp_query, 1, "menu_name", 1, 2, image_key) + .LastInsertId(); FillApplicationCommandsArrayTable(temp_query, app_key, command_key); - FillVRCommandsArrayTable(temp_query, "best", kVRCommandFromCommand, - command_key); + FillVRCommandsArrayTable( + temp_query, "best", kVRCommandFromCommand, command_key); ValToPosPair p1(0, app_id1); ValToPosPair p2(1, device_id); // Check @@ -2067,20 +2644,31 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCommandsFromCommand_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kSelectCommandsFromChoice_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t app_key = - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id1, device_id, 9).LastInsertId(); + int64_t app_key = FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id1, + device_id, + 9).LastInsertId(); int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId(); - int64_t choice_key = FillChoiceTable(temp_query, 1, "menu_name", "sec_text", - "tert_text", image_key).LastInsertId(); - int64_t command_key = FillCommandTable(temp_query, 1, "menu_name", 1, 2, - image_key).LastInsertId(); + int64_t choice_key = + FillChoiceTable( + temp_query, 1, "menu_name", "sec_text", "tert_text", image_key) + .LastInsertId(); + int64_t command_key = + FillCommandTable(temp_query, 1, "menu_name", 1, 2, image_key) + .LastInsertId(); FillApplicationCommandsArrayTable(temp_query, app_key, command_key); - FillVRCommandsArrayTable(temp_query, "best", kVRCommandFromChoice, - choice_key); + FillVRCommandsArrayTable( + temp_query, "best", kVRCommandFromChoice, choice_key); ValToPosPair p1(0, app_id1); ValToPosPair p2(1, device_id); const std::string kChecksVrCommandFromSelectCommand = @@ -2109,10 +2697,18 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCommandsFromChoice_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kSelectCountSubscriptions_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t app_key = - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id1, device_id, 9).LastInsertId(); + int64_t app_key = FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id1, + device_id, + 9).LastInsertId(); FillAppSubscriptionsArrayTable(temp_query, 2, 3, app_key); ValToPosPair p1(0, app_id1); ValToPosPair p2(1, device_id); @@ -2123,10 +2719,18 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCountSubscriptions_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kSelectSubscriptions_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t app_key = - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id1, device_id, 9).LastInsertId(); + int64_t app_key = FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id1, + device_id, + 9).LastInsertId(); FillAppSubscriptionsArrayTable(temp_query, 2, 3, app_key); ValToPosPair p1(0, app_id1); ValToPosPair p2(1, device_id); @@ -2138,10 +2742,18 @@ TEST_F(ResumptionSqlQueriesTest, kSelectSubscriptions_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kSelectCountChoiceSet_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t app_key = - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id1, device_id, 9).LastInsertId(); + int64_t app_key = FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id1, + device_id, + 9).LastInsertId(); FillApplicationChoiceSetArrayTable(temp_query, 2, app_key); ValToPosPair p1(0, app_id1); ValToPosPair p2(1, device_id); @@ -2152,20 +2764,30 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCountChoiceSet_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kSelectChoiceSets_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - int64_t app_key = - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id1, device_id, 9).LastInsertId(); + int64_t app_key = FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id1, + device_id, + 9).LastInsertId(); int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId(); - int64_t choice_key = FillChoiceTable(temp_query, 1, "menu_name", "sec_text", - "tert_text", image_key).LastInsertId(); + int64_t choice_key = + FillChoiceTable( + temp_query, 1, "menu_name", "sec_text", "tert_text", image_key) + .LastInsertId(); int64_t app_choice_set_key = FillApplicationChoiceSetTable(temp_query, 23, 2).LastInsertId(); FillChoiceArrayTable(temp_query, app_choice_set_key, choice_key); FillApplicationChoiceSetArrayTable(temp_query, app_choice_set_key, app_key); - FillVRCommandsArrayTable(temp_query, "best", kVRCommandFromChoice, - choice_key); + FillVRCommandsArrayTable( + temp_query, "best", kVRCommandFromChoice, choice_key); ValToPosPair p1(0, app_id1); ValToPosPair p2(1, device_id); @@ -2199,11 +2821,21 @@ TEST_F(ResumptionSqlQueriesTest, // Arrange SQLQuery temp_query(db()); int64_t glob_prop_key = - FillGlobalPropertiesTable(temp_query, "tst_vr_title", "tst_menu", 2, 3, 3, - "auto", 5).LastInsertId(); - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id1, device_id, glob_prop_key).LastInsertId(); + FillGlobalPropertiesTable( + temp_query, "tst_vr_title", "tst_menu", 2, 3, 3, "auto", 5) + .LastInsertId(); + FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id1, + device_id, + glob_prop_key).LastInsertId(); // Check ValToPosPair p1(0, app_id1); @@ -2216,11 +2848,21 @@ TEST_F(ResumptionSqlQueriesTest, kSelectGlobalProperties_ExpectDataCorrect) { SQLQuery temp_query(db()); int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId(); int64_t glob_prop_key = - FillGlobalPropertiesTable(temp_query, "tst_vr_title", "tst_menu", 2, 3, 3, - "auto", image_key).LastInsertId(); - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id1, device_id, glob_prop_key).LastInsertId(); + FillGlobalPropertiesTable( + temp_query, "tst_vr_title", "tst_menu", 2, 3, 3, "auto", image_key) + .LastInsertId(); + FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id1, + device_id, + glob_prop_key).LastInsertId(); FillHelpTimeoutPromptArrayTable(temp_query, glob_prop_key, 3, 7); // Check @@ -2243,8 +2885,9 @@ TEST_F(ResumptionSqlQueriesTest, kChecksVrHelpItem_ExpectDataCorrect) { SQLQuery temp_query(db()); int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId(); int64_t glob_prop_key = - FillGlobalPropertiesTable(temp_query, "tst_vr_title", "tst_menu", 2, 3, 3, - "auto", image_key).LastInsertId(); + FillGlobalPropertiesTable( + temp_query, "tst_vr_title", "tst_menu", 2, 3, 3, "auto", image_key) + .LastInsertId(); int64_t vr_help_item_key = FillVRHelpItemTable(temp_query, "tst_text", 2, image_key).LastInsertId(); FillVRHelpItemArrayTable(temp_query, glob_prop_key, vr_help_item_key); @@ -2259,8 +2902,9 @@ TEST_F(ResumptionSqlQueriesTest, kSelectVrHelpItem_ExpectDataCorrect) { SQLQuery temp_query(db()); int64_t image_key = FillImageTable(temp_query, 2, "tst_image").LastInsertId(); int64_t glob_prop_key = - FillGlobalPropertiesTable(temp_query, "tst_vr_title", "tst_menu", 2, 3, 3, - "auto", image_key).LastInsertId(); + FillGlobalPropertiesTable( + temp_query, "tst_vr_title", "tst_menu", 2, 3, 3, "auto", image_key) + .LastInsertId(); int64_t vr_help_item_key = FillVRHelpItemTable(temp_query, "tst_text", 2, image_key).LastInsertId(); FillVRHelpItemArrayTable(temp_query, glob_prop_key, vr_help_item_key); @@ -2277,8 +2921,9 @@ TEST_F(ResumptionSqlQueriesTest, kChecksCharacter_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); int64_t glob_prop_key = - FillGlobalPropertiesTable(temp_query, "tst_vr_title", "tst_menu", 2, 3, 3, - "auto", 2).LastInsertId(); + FillGlobalPropertiesTable( + 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(); @@ -2293,8 +2938,9 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCharacter_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); int64_t glob_prop_key = - FillGlobalPropertiesTable(temp_query, "tst_vr_title", "tst_menu", 2, 3, 3, - "auto", 2).LastInsertId(); + FillGlobalPropertiesTable( + 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(); @@ -2308,13 +2954,31 @@ TEST_F(ResumptionSqlQueriesTest, kSelectCharacter_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kSelectAllApps_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id1, device_id, 1); - - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id2, device_id2, 2); + FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id1, + device_id, + 1); + + FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id2, + device_id2, + 2); // Checks SQLQuery query(db()); EXPECT_TRUE(query.Prepare(kSelectAllApps) && query.Exec()); @@ -2328,9 +2992,18 @@ TEST_F(ResumptionSqlQueriesTest, kSelectAllApps_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kUpdateApplicationData_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, false, - app_id1, device_id, 1); + FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + false, + app_id1, + device_id, + 1); string select_hmi_level_and_time_stamp = "SELECT `hmiLevel`, `timeStamp`FROM `application` " "WHERE `appID` = ? AND `deviceID` = ?;"; @@ -2384,9 +3057,18 @@ TEST_F(ResumptionSqlQueriesTest, kSelectTTSChunk_ExpectDataCorrect) { TEST_F(ResumptionSqlQueriesTest, kSelectAppTable_ExpectDataCorrect) { // Arrange SQLQuery temp_query(db()); - FillApplicationTable(temp_query, connection_key, grammarID, test_hash, - hmiAppID, hmiLevel, ign_off_count, timeStamp, true, - app_id1, device_id, 1); + FillApplicationTable(temp_query, + connection_key, + grammarID, + test_hash, + hmiAppID, + hmiLevel, + ign_off_count, + timeStamp, + true, + app_id1, + device_id, + 1); ValToPosPair p1(0, app_id1); ValToPosPair p2(1, device_id); diff --git a/src/components/application_manager/test/state_controller/include/application_mock.h b/src/components/application_manager/test/state_controller/include/application_mock.h index 8d01795fe8..9896ecfdd4 100644 --- a/src/components/application_manager/test/state_controller/include/application_mock.h +++ b/src/components/application_manager/test/state_controller/include/application_mock.h @@ -49,330 +49,228 @@ namespace custom_str = utils::custom_string; class MockApplication : public application_manager::Application { public: // InitialApplicationData - MOCK_CONST_METHOD0(app_types, - const smart_objects::SmartObject*()); - MOCK_CONST_METHOD0(vr_synonyms, - const smart_objects::SmartObject*()); - MOCK_CONST_METHOD0(mac_address, - const std::string&()); - MOCK_CONST_METHOD0(mobile_app_id, - std::string()); - MOCK_CONST_METHOD0(tts_name, - const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(app_types, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(vr_synonyms, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(mac_address, const std::string&()); + MOCK_CONST_METHOD0(mobile_app_id, std::string()); + MOCK_CONST_METHOD0(tts_name, const smart_objects::SmartObject*()); MOCK_CONST_METHOD0(ngn_media_screen_name, - const smart_objects::SmartObject*()); - MOCK_CONST_METHOD0(language, - const mobile_apis::Language::eType&()); - MOCK_CONST_METHOD0(ui_language, - const mobile_apis::Language::eType&()); + const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(language, const mobile_apis::Language::eType&()); + MOCK_CONST_METHOD0(ui_language, const mobile_apis::Language::eType&()); MOCK_METHOD1(set_app_types, - void(const smart_objects::SmartObject& app_types)); + void(const smart_objects::SmartObject& app_types)); MOCK_METHOD1(set_vr_synonyms, - void(const smart_objects::SmartObject& vr_synonyms)); - MOCK_METHOD1(set_mobile_app_id, - void(const std::string& mobile_app_id)); - MOCK_METHOD1(set_tts_name, - void(const smart_objects::SmartObject& tts_name)); + void(const smart_objects::SmartObject& vr_synonyms)); + MOCK_METHOD1(set_mobile_app_id, void(const std::string& mobile_app_id)); + MOCK_METHOD1(set_tts_name, void(const smart_objects::SmartObject& tts_name)); MOCK_METHOD1(set_ngn_media_screen_name, - void(const smart_objects::SmartObject& ngn_name)); + void(const smart_objects::SmartObject& ngn_name)); MOCK_METHOD1(set_language, - void(const mobile_apis::Language::eType& language)); + void(const mobile_apis::Language::eType& language)); MOCK_METHOD1(set_ui_language, - void(const mobile_apis::Language::eType& ui_language)); + void(const mobile_apis::Language::eType& ui_language)); // DynamicApplicationData - MOCK_CONST_METHOD0(help_prompt, - const smart_objects::SmartObject*()); - MOCK_CONST_METHOD0(timeout_prompt, - const smart_objects::SmartObject*()); - MOCK_CONST_METHOD0(vr_help_title, - const smart_objects::SmartObject*()); - MOCK_CONST_METHOD0(vr_help, - const smart_objects::SmartObject*()); - MOCK_CONST_METHOD0(tbt_state, - const mobile_apis::TBTState::eType&()); - MOCK_CONST_METHOD0(show_command, - const smart_objects::SmartObject*()); - MOCK_CONST_METHOD0(tbt_show_command, - const smart_objects::SmartObject*()); - MOCK_CONST_METHOD0(SubscribedButtons, - DataAccessor<application_manager::ButtonSubscriptions>()); - MOCK_CONST_METHOD0(SubscribedIVI, - DataAccessor<application_manager::VehicleInfoSubscriptions>()); - MOCK_CONST_METHOD0(keyboard_props, - const smart_objects::SmartObject*()); - MOCK_CONST_METHOD0(menu_title, - const smart_objects::SmartObject*()); - MOCK_CONST_METHOD0(menu_icon, - const smart_objects::SmartObject*()); - MOCK_METHOD1(load_global_properties, - void(const smart_objects::SmartObject& so)); - MOCK_METHOD1(set_help_prompt, - void(const smart_objects::SmartObject& help_prompt)); - MOCK_METHOD1(set_timeout_prompt, - void(const smart_objects::SmartObject& timeout_prompt)); - MOCK_METHOD1(set_vr_help_title, - void(const smart_objects::SmartObject& vr_help_title)); - MOCK_METHOD0(reset_vr_help_title, - void()); - MOCK_METHOD1(set_vr_help, - void(const smart_objects::SmartObject& vr_help)); - MOCK_METHOD0(reset_vr_help, - void()); - MOCK_METHOD1(set_tbt_state, - void(const mobile_apis::TBTState::eType& tbt_state)); - MOCK_METHOD1(set_show_command, - void(const smart_objects::SmartObject& show_command)); - MOCK_METHOD1(set_tbt_show_command, - void(const smart_objects::SmartObject& tbt_show)); - MOCK_METHOD1(set_keyboard_props, - void(const smart_objects::SmartObject& keyboard_props)); - MOCK_METHOD1(set_menu_title, - void(const smart_objects::SmartObject& menu_title)); - MOCK_METHOD1(set_menu_icon, - void(const smart_objects::SmartObject& menu_icon)); - MOCK_CONST_METHOD0(audio_stream_retry_number, - uint32_t()); - MOCK_METHOD1(set_audio_stream_retry_number, - void(const uint32_t& audio_stream_retry_number)); - MOCK_CONST_METHOD0(video_stream_retry_number, - uint32_t()); - MOCK_METHOD1(set_video_stream_retry_number, - void(const uint32_t& video_stream_retry_number)); - MOCK_METHOD2(AddCommand, - void(uint32_t cmd_id, const smart_objects::SmartObject& command)); - MOCK_METHOD1(RemoveCommand, - void(uint32_t cmd_id)); - MOCK_METHOD1(FindCommand, - smart_objects::SmartObject*(uint32_t cmd_id)); - MOCK_METHOD2(AddSubMenu, - void(uint32_t menu_id, const smart_objects::SmartObject& menu)); - MOCK_METHOD1(RemoveSubMenu, - void(uint32_t menu_id)); - MOCK_CONST_METHOD1(FindSubMenu, - smart_objects::SmartObject*(uint32_t menu_id)); - MOCK_METHOD1(IsSubMenuNameAlreadyExist, - bool(const std::string& name)); - MOCK_METHOD2(AddChoiceSet, - void(uint32_t choice_set_id, const smart_objects::SmartObject& choice_set)); - MOCK_METHOD1(RemoveChoiceSet, - void(uint32_t choice_set_id)); - MOCK_METHOD1(FindChoiceSet, - smart_objects::SmartObject*(uint32_t choice_set_id)); - MOCK_METHOD3(AddPerformInteractionChoiceSet, - void(uint32_t correlation_id, uint32_t choice_set_id, const smart_objects::SmartObject& choice_set)); - MOCK_METHOD1(DeletePerformInteractionChoiceSet, - void(uint32_t correlation_id)); - MOCK_CONST_METHOD0(performinteraction_choice_set_map, - DataAccessor<application_manager::PerformChoiceSetMap>()); - MOCK_CONST_METHOD0(commands_map, - DataAccessor<application_manager::CommandsMap>()); - MOCK_CONST_METHOD0(sub_menu_map, - DataAccessor<application_manager::SubMenuMap>()); - MOCK_CONST_METHOD0(choice_set_map, - DataAccessor<application_manager::ChoiceSetMap>()); - MOCK_METHOD1(set_perform_interaction_active, - void(uint32_t active)); - MOCK_CONST_METHOD0(is_perform_interaction_active, - uint32_t()); - MOCK_METHOD1(set_perform_interaction_layout, - void(mobile_apis::LayoutMode::eType layout)); - MOCK_CONST_METHOD0(perform_interaction_layout, - mobile_apis::LayoutMode::eType()); - MOCK_METHOD1(set_perform_interaction_mode, - void(int32_t mode)); - MOCK_CONST_METHOD0(perform_interaction_mode, - int32_t()); - MOCK_METHOD1(set_reset_global_properties_active, - void(bool active)); - MOCK_CONST_METHOD0(is_reset_global_properties_active, - bool()); -// Application + MOCK_CONST_METHOD0(help_prompt, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(timeout_prompt, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(vr_help_title, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(vr_help, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(tbt_state, const mobile_apis::TBTState::eType&()); + MOCK_CONST_METHOD0(show_command, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(tbt_show_command, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(SubscribedButtons, + DataAccessor<application_manager::ButtonSubscriptions>()); + MOCK_CONST_METHOD0( + SubscribedIVI, + DataAccessor<application_manager::VehicleInfoSubscriptions>()); + MOCK_CONST_METHOD0(keyboard_props, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(menu_title, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(menu_icon, const smart_objects::SmartObject*()); + MOCK_METHOD1(load_global_properties, + void(const smart_objects::SmartObject& so)); + MOCK_METHOD1(set_help_prompt, + void(const smart_objects::SmartObject& help_prompt)); + MOCK_METHOD1(set_timeout_prompt, + void(const smart_objects::SmartObject& timeout_prompt)); + MOCK_METHOD1(set_vr_help_title, + void(const smart_objects::SmartObject& vr_help_title)); + MOCK_METHOD0(reset_vr_help_title, void()); + MOCK_METHOD1(set_vr_help, void(const smart_objects::SmartObject& vr_help)); + MOCK_METHOD0(reset_vr_help, void()); + MOCK_METHOD1(set_tbt_state, + void(const mobile_apis::TBTState::eType& tbt_state)); + MOCK_METHOD1(set_show_command, + void(const smart_objects::SmartObject& show_command)); + MOCK_METHOD1(set_tbt_show_command, + void(const smart_objects::SmartObject& tbt_show)); + MOCK_METHOD1(set_keyboard_props, + void(const smart_objects::SmartObject& keyboard_props)); + MOCK_METHOD1(set_menu_title, + void(const smart_objects::SmartObject& menu_title)); + MOCK_METHOD1(set_menu_icon, + void(const smart_objects::SmartObject& menu_icon)); + MOCK_CONST_METHOD0(audio_stream_retry_number, uint32_t()); + MOCK_METHOD1(set_audio_stream_retry_number, + void(const uint32_t& audio_stream_retry_number)); + MOCK_CONST_METHOD0(video_stream_retry_number, uint32_t()); + MOCK_METHOD1(set_video_stream_retry_number, + void(const uint32_t& video_stream_retry_number)); + MOCK_METHOD2(AddCommand, + void(uint32_t cmd_id, + const smart_objects::SmartObject& command)); + MOCK_METHOD1(RemoveCommand, void(uint32_t cmd_id)); + MOCK_METHOD1(FindCommand, smart_objects::SmartObject*(uint32_t cmd_id)); + MOCK_METHOD2(AddSubMenu, + void(uint32_t menu_id, const smart_objects::SmartObject& menu)); + MOCK_METHOD1(RemoveSubMenu, void(uint32_t menu_id)); + MOCK_CONST_METHOD1(FindSubMenu, + smart_objects::SmartObject*(uint32_t menu_id)); + MOCK_METHOD1(IsSubMenuNameAlreadyExist, bool(const std::string& name)); + MOCK_METHOD2(AddChoiceSet, + void(uint32_t choice_set_id, + const smart_objects::SmartObject& choice_set)); + MOCK_METHOD1(RemoveChoiceSet, void(uint32_t choice_set_id)); + MOCK_METHOD1(FindChoiceSet, + smart_objects::SmartObject*(uint32_t choice_set_id)); + MOCK_METHOD3(AddPerformInteractionChoiceSet, + void(uint32_t correlation_id, + uint32_t choice_set_id, + const smart_objects::SmartObject& choice_set)); + MOCK_METHOD1(DeletePerformInteractionChoiceSet, + void(uint32_t correlation_id)); + MOCK_CONST_METHOD0(performinteraction_choice_set_map, + DataAccessor<application_manager::PerformChoiceSetMap>()); + MOCK_CONST_METHOD0(commands_map, + DataAccessor<application_manager::CommandsMap>()); + MOCK_CONST_METHOD0(sub_menu_map, + DataAccessor<application_manager::SubMenuMap>()); + MOCK_CONST_METHOD0(choice_set_map, + DataAccessor<application_manager::ChoiceSetMap>()); + MOCK_METHOD1(set_perform_interaction_active, void(uint32_t active)); + MOCK_CONST_METHOD0(is_perform_interaction_active, uint32_t()); + MOCK_METHOD1(set_perform_interaction_layout, + void(mobile_apis::LayoutMode::eType layout)); + MOCK_CONST_METHOD0(perform_interaction_layout, + mobile_apis::LayoutMode::eType()); + MOCK_METHOD1(set_perform_interaction_mode, void(int32_t mode)); + MOCK_CONST_METHOD0(perform_interaction_mode, int32_t()); + MOCK_METHOD1(set_reset_global_properties_active, void(bool active)); + MOCK_CONST_METHOD0(is_reset_global_properties_active, bool()); + // Application - MOCK_CONST_METHOD0(active_message, - const smart_objects::SmartObject*()); - MOCK_CONST_METHOD0(curHash, - const std::string&()); - MOCK_METHOD0(UpdateHash, - void()); - MOCK_CONST_METHOD0(is_application_data_changed, - bool()); + MOCK_CONST_METHOD0(active_message, const smart_objects::SmartObject*()); + MOCK_CONST_METHOD0(curHash, const std::string&()); + MOCK_METHOD0(UpdateHash, void()); + MOCK_CONST_METHOD0(is_application_data_changed, bool()); MOCK_METHOD1(set_is_application_data_changed, - void(bool state_application_data)); - MOCK_METHOD0(CloseActiveMessage, - void()); - MOCK_CONST_METHOD0(IsFullscreen, - bool()); - MOCK_METHOD0(ChangeSupportingAppHMIType, - void()); - MOCK_CONST_METHOD0(is_navi, - bool()); - MOCK_METHOD1(set_is_navi, - void(bool allow)); - MOCK_CONST_METHOD0(video_streaming_approved, - bool()); - MOCK_METHOD1(set_video_streaming_approved, - void(bool state)); - MOCK_CONST_METHOD0(audio_streaming_approved, - bool()); - MOCK_METHOD1(set_audio_streaming_approved, - void(bool state)); - MOCK_CONST_METHOD0(video_streaming_allowed, - bool()); - MOCK_METHOD1(set_video_streaming_allowed, - void(bool state)); - MOCK_CONST_METHOD0(audio_streaming_allowed, - bool()); - MOCK_METHOD1(set_audio_streaming_allowed, - void(bool state)); + void(bool state_application_data)); + MOCK_METHOD0(CloseActiveMessage, void()); + MOCK_CONST_METHOD0(IsFullscreen, bool()); + MOCK_METHOD0(ChangeSupportingAppHMIType, void()); + MOCK_CONST_METHOD0(is_navi, bool()); + MOCK_METHOD1(set_is_navi, void(bool allow)); + MOCK_CONST_METHOD0(video_streaming_approved, bool()); + MOCK_METHOD1(set_video_streaming_approved, void(bool state)); + MOCK_CONST_METHOD0(audio_streaming_approved, bool()); + MOCK_METHOD1(set_audio_streaming_approved, void(bool state)); + MOCK_CONST_METHOD0(video_streaming_allowed, bool()); + MOCK_METHOD1(set_video_streaming_allowed, void(bool state)); + MOCK_CONST_METHOD0(audio_streaming_allowed, bool()); + MOCK_METHOD1(set_audio_streaming_allowed, void(bool state)); MOCK_METHOD1(StartStreaming, - void(protocol_handler::ServiceType service_type)); + void(protocol_handler::ServiceType service_type)); MOCK_METHOD1(StopStreamingForce, - void(protocol_handler::ServiceType service_type)); - MOCK_METHOD1(StopStreaming, - void(protocol_handler::ServiceType service_type)); + void(protocol_handler::ServiceType service_type)); + MOCK_METHOD1(StopStreaming, void(protocol_handler::ServiceType service_type)); MOCK_METHOD1(SuspendStreaming, - void(protocol_handler::ServiceType service_type)); + void(protocol_handler::ServiceType service_type)); MOCK_METHOD1(WakeUpStreaming, - void(protocol_handler::ServiceType service_type)); - MOCK_CONST_METHOD0(is_voice_communication_supported, - bool()); + void(protocol_handler::ServiceType service_type)); + MOCK_CONST_METHOD0(is_voice_communication_supported, bool()); MOCK_METHOD1(set_voice_communication_supported, - void(bool is_voice_communication_supported)); - MOCK_CONST_METHOD0(app_allowed, - bool()); - MOCK_CONST_METHOD0(has_been_activated, - bool()); - MOCK_METHOD1(set_activated, - bool(bool is_active)); - MOCK_CONST_METHOD0(version, - const application_manager::Version&()); - MOCK_METHOD1(set_hmi_application_id, - void(uint32_t hmi_app_id)); - MOCK_CONST_METHOD0(hmi_app_id, - uint32_t()); - MOCK_CONST_METHOD0(app_id, - uint32_t()); - MOCK_CONST_METHOD0(name, - const custom_str::CustomString&()); - MOCK_METHOD1(set_folder_name, - void(const std::string& folder_name)); - MOCK_CONST_METHOD0(folder_name, - const std::string()); - MOCK_CONST_METHOD0(is_media_application, - bool()); - MOCK_CONST_METHOD0(is_foreground, - bool()); - MOCK_METHOD1(set_foreground, - void(bool is_foreground)); - MOCK_CONST_METHOD0(hmi_level, - const mobile_apis::HMILevel::eType()); - MOCK_CONST_METHOD0(put_file_in_none_count, - const uint32_t()); - MOCK_CONST_METHOD0(delete_file_in_none_count, - const uint32_t()); - MOCK_CONST_METHOD0(list_files_in_none_count, - const uint32_t()); - MOCK_CONST_METHOD0(system_context, - const mobile_apis::SystemContext::eType()); + void(bool is_voice_communication_supported)); + MOCK_CONST_METHOD0(app_allowed, bool()); + MOCK_CONST_METHOD0(has_been_activated, bool()); + MOCK_METHOD1(set_activated, bool(bool is_active)); + MOCK_CONST_METHOD0(version, const application_manager::Version&()); + MOCK_METHOD1(set_hmi_application_id, void(uint32_t hmi_app_id)); + MOCK_CONST_METHOD0(hmi_app_id, uint32_t()); + MOCK_CONST_METHOD0(app_id, uint32_t()); + MOCK_CONST_METHOD0(name, const custom_str::CustomString&()); + MOCK_METHOD1(set_folder_name, void(const std::string& folder_name)); + MOCK_CONST_METHOD0(folder_name, const std::string()); + MOCK_CONST_METHOD0(is_media_application, bool()); + MOCK_CONST_METHOD0(is_foreground, bool()); + MOCK_METHOD1(set_foreground, void(bool is_foreground)); + MOCK_CONST_METHOD0(hmi_level, const mobile_apis::HMILevel::eType()); + MOCK_CONST_METHOD0(put_file_in_none_count, const uint32_t()); + MOCK_CONST_METHOD0(delete_file_in_none_count, const uint32_t()); + MOCK_CONST_METHOD0(list_files_in_none_count, const uint32_t()); + MOCK_CONST_METHOD0(system_context, const mobile_apis::SystemContext::eType()); MOCK_CONST_METHOD0(audio_streaming_state, - const mobile_apis::AudioStreamingState::eType()); - MOCK_CONST_METHOD0(app_icon_path, - const std::string&()); - MOCK_CONST_METHOD0(device, - connection_handler::DeviceHandle()); - MOCK_METHOD1(set_tts_properties_in_none, - void(bool active)); - MOCK_METHOD0(tts_properties_in_none, - bool()); - MOCK_METHOD1(set_tts_properties_in_full, - void(bool active)); - MOCK_METHOD0(tts_properties_in_full, - bool()); - MOCK_METHOD1(set_version, - void(const application_manager::Version& version)); - MOCK_METHOD1(set_name, - void(const custom_str::CustomString& name)); - MOCK_METHOD1(set_is_media_application, - void(bool is_media)); - MOCK_METHOD0(increment_put_file_in_none_count, - void()); - MOCK_METHOD0(increment_delete_file_in_none_count, - void()); - MOCK_METHOD0(increment_list_files_in_none_count, - void()); - MOCK_METHOD1(set_app_icon_path, - bool(const std::string& file_name)); - MOCK_METHOD1(set_app_allowed, - void(const bool allowed)); - MOCK_METHOD1(set_device, - void(connection_handler::DeviceHandle device)); - MOCK_CONST_METHOD0(get_grammar_id, - uint32_t()); - MOCK_METHOD1(set_grammar_id, - void(uint32_t value)); - MOCK_METHOD1(set_protocol_version, + const mobile_apis::AudioStreamingState::eType()); + MOCK_CONST_METHOD0(app_icon_path, const std::string&()); + MOCK_CONST_METHOD0(device, connection_handler::DeviceHandle()); + MOCK_METHOD1(set_tts_properties_in_none, void(bool active)); + MOCK_METHOD0(tts_properties_in_none, bool()); + MOCK_METHOD1(set_tts_properties_in_full, void(bool active)); + MOCK_METHOD0(tts_properties_in_full, bool()); + MOCK_METHOD1(set_version, void(const application_manager::Version& version)); + MOCK_METHOD1(set_name, void(const custom_str::CustomString& name)); + MOCK_METHOD1(set_is_media_application, void(bool is_media)); + MOCK_METHOD0(increment_put_file_in_none_count, void()); + MOCK_METHOD0(increment_delete_file_in_none_count, void()); + MOCK_METHOD0(increment_list_files_in_none_count, void()); + MOCK_METHOD1(set_app_icon_path, bool(const std::string& file_name)); + MOCK_METHOD1(set_app_allowed, void(const bool allowed)); + MOCK_METHOD1(set_device, void(connection_handler::DeviceHandle device)); + MOCK_CONST_METHOD0(get_grammar_id, uint32_t()); + MOCK_METHOD1(set_grammar_id, void(uint32_t value)); + MOCK_METHOD1( + set_protocol_version, void(const application_manager::ProtocolVersion& protocol_version)); - MOCK_CONST_METHOD0(protocol_version, - application_manager::ProtocolVersion()); - MOCK_METHOD1(set_is_resuming, - void(bool is_resuming)); - MOCK_CONST_METHOD0(is_resuming, - bool()); - MOCK_METHOD1(AddFile, - bool(const application_manager::AppFile& file)); - MOCK_CONST_METHOD0(getAppFiles, - const application_manager::AppFilesMap&()); - MOCK_METHOD1(UpdateFile, - bool(const application_manager::AppFile& file)); - MOCK_METHOD1(DeleteFile, - bool(const std::string& file_name)); - MOCK_METHOD1(GetFile, + MOCK_CONST_METHOD0(protocol_version, application_manager::ProtocolVersion()); + MOCK_METHOD1(set_is_resuming, void(bool is_resuming)); + MOCK_CONST_METHOD0(is_resuming, bool()); + MOCK_METHOD1(AddFile, bool(const application_manager::AppFile& file)); + MOCK_CONST_METHOD0(getAppFiles, const application_manager::AppFilesMap&()); + MOCK_METHOD1(UpdateFile, bool(const application_manager::AppFile& file)); + MOCK_METHOD1(DeleteFile, bool(const std::string& file_name)); + MOCK_METHOD1( + GetFile, const application_manager::AppFile*(const std::string& file_name)); MOCK_METHOD1(SubscribeToButton, - bool(mobile_apis::ButtonName::eType btn_name)); + bool(mobile_apis::ButtonName::eType btn_name)); MOCK_METHOD1(IsSubscribedToButton, - bool(mobile_apis::ButtonName::eType btn_name)); + bool(mobile_apis::ButtonName::eType btn_name)); MOCK_METHOD1(UnsubscribeFromButton, - bool(mobile_apis::ButtonName::eType btn_name)); - MOCK_METHOD1(SubscribeToIVI, - bool(uint32_t vehicle_info_type)); - MOCK_CONST_METHOD1(IsSubscribedToIVI, - bool(uint32_t vehicle_info_type)); - MOCK_METHOD1(UnsubscribeFromIVI, - bool(uint32_t vehicle_info_type)); - MOCK_METHOD0(ResetDataInNone, - void()); + bool(mobile_apis::ButtonName::eType btn_name)); + MOCK_METHOD1(SubscribeToIVI, bool(uint32_t vehicle_info_type)); + MOCK_CONST_METHOD1(IsSubscribedToIVI, bool(uint32_t vehicle_info_type)); + MOCK_METHOD1(UnsubscribeFromIVI, bool(uint32_t vehicle_info_type)); + MOCK_METHOD0(ResetDataInNone, void()); MOCK_METHOD2(IsCommandLimitsExceeded, - bool(mobile_apis::FunctionID::eType cmd_id, application_manager::TLimitSource source)); - MOCK_METHOD0(usage_report, - application_manager::UsageStatistics&()); - MOCK_METHOD1(SetRegularState, - void(application_manager::HmiStatePtr state)); - MOCK_METHOD1(SetPostponedState, - void(application_manager::HmiStatePtr state)); - MOCK_METHOD0(RemovePostponedState, - void()); - MOCK_METHOD1(AddHMIState, - void(application_manager::HmiStatePtr state)); + bool(mobile_apis::FunctionID::eType cmd_id, + application_manager::TLimitSource source)); + MOCK_METHOD0(usage_report, application_manager::UsageStatistics&()); + MOCK_METHOD1(SetRegularState, void(application_manager::HmiStatePtr state)); + MOCK_METHOD1(SetPostponedState, void(application_manager::HmiStatePtr state)); + MOCK_METHOD0(RemovePostponedState, void()); + MOCK_METHOD1(AddHMIState, void(application_manager::HmiStatePtr state)); MOCK_METHOD1(RemoveHMIState, - void(application_manager::HmiState::StateID state_id)); - MOCK_CONST_METHOD0(CurrentHmiState, - const application_manager::HmiStatePtr()); - MOCK_CONST_METHOD0(RegularHmiState, - const application_manager::HmiStatePtr()); + void(application_manager::HmiState::StateID state_id)); + MOCK_CONST_METHOD0(CurrentHmiState, const application_manager::HmiStatePtr()); + MOCK_CONST_METHOD0(RegularHmiState, const application_manager::HmiStatePtr()); MOCK_CONST_METHOD0(PostponedHmiState, - const application_manager::HmiStatePtr()); + const application_manager::HmiStatePtr()); MOCK_METHOD2(SubscribeToSoftButtons, - void(int32_t cmd_id, const application_manager::SoftButtonID& softbuttons_id)); - MOCK_METHOD1(IsSubscribedToSoftButton, - bool(const uint32_t softbutton_id)); - MOCK_METHOD1(UnsubscribeFromSoftButtons, - void(int32_t cmd_id)); - MOCK_CONST_METHOD0(IsAudioApplication, - bool()); - MOCK_METHOD0(LoadPersistentFiles, - void()); + void(int32_t cmd_id, + const application_manager::SoftButtonID& softbuttons_id)); + MOCK_METHOD1(IsSubscribedToSoftButton, bool(const uint32_t softbutton_id)); + MOCK_METHOD1(UnsubscribeFromSoftButtons, void(int32_t cmd_id)); + MOCK_CONST_METHOD0(IsAudioApplication, bool()); + MOCK_METHOD0(LoadPersistentFiles, void()); }; } // namespace state_controller_test diff --git a/src/components/application_manager/test/state_controller/include/statistics_manager_mock.h b/src/components/application_manager/test/state_controller/include/statistics_manager_mock.h index 4c97b15dcd..cff4194118 100644 --- a/src/components/application_manager/test/state_controller/include/statistics_manager_mock.h +++ b/src/components/application_manager/test/state_controller/include/statistics_manager_mock.h @@ -45,10 +45,11 @@ namespace us = usage_statistics; class MockStatisticsManager : public us::StatisticsManager { public: - MOCK_METHOD1(Increment, void (us::GlobalCounterId)); - MOCK_METHOD2(Increment, void (const std::string&, us::AppCounterId)); - MOCK_METHOD3(Set, void (const std::string&, us::AppInfoId, const std::string&)); - MOCK_METHOD3(Add, void (const std::string&, us::AppStopwatchId, int32_t)); + MOCK_METHOD1(Increment, void(us::GlobalCounterId)); + MOCK_METHOD2(Increment, void(const std::string&, us::AppCounterId)); + MOCK_METHOD3(Set, + void(const std::string&, us::AppInfoId, const std::string&)); + MOCK_METHOD3(Add, void(const std::string&, us::AppStopwatchId, int32_t)); }; } // namespace state_controller_test 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 452d269855..dfd1319273 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 @@ -132,10 +132,11 @@ class StateControllerImplTest : public ::testing::Test { utils::SharedPtr<usage_statistics::StatisticsManager>( new state_controller_test::MockStatisticsManager)) - , applications_(application_set_, applications_lock_){} + , applications_(application_set_, applications_lock_) {} NiceMock<application_manager_test::MockApplicationManager> app_manager_mock_; NiceMock<policy_test::MockPolicyHandlerInterface> policy_interface_; - NiceMock<connection_handler_test::MockConnectionHandler> mock_connection_handler_; + NiceMock<connection_handler_test::MockConnectionHandler> + mock_connection_handler_; NiceMock<protocol_handler_test::MockSessionObserver> mock_session_observer_; am::UsageStatistics usage_stat; @@ -277,9 +278,10 @@ class StateControllerImplTest : public ::testing::Test { switch (app_t) { case APP_TYPE_NON_MEDIA: { PrepareCommonStateResults(result_hmi_state); - result_hmi_state.push_back(createHmiState( - HMILevel::HMI_FULL, AudioStreamingState::NOT_AUDIBLE, - SystemContext::SYSCTXT_MAIN)); + result_hmi_state.push_back( + createHmiState(HMILevel::HMI_FULL, + AudioStreamingState::NOT_AUDIBLE, + SystemContext::SYSCTXT_MAIN)); break; } case APP_TYPE_MEDIA: { @@ -455,11 +457,10 @@ class StateControllerImplTest : public ::testing::Test { // application properties, i.e. is_media_application flag from RAI and // AppHMITypes (NAVIGATION, etc.). Most likely logic should be changed // after conclusion on APPLINK-20231 - std::vector<am::ApplicationSharedPtr>::iterator app = - std::find_if( - applications_list_.begin(), - applications_list_.end(), - [app_id](am::ApplicationSharedPtr a){return app_id == a->app_id();}); + std::vector<am::ApplicationSharedPtr>::iterator app = std::find_if( + applications_list_.begin(), + applications_list_.end(), + [app_id](am::ApplicationSharedPtr a) { return app_id == a->app_id(); }); if (app == applications_list_.end()) { return APP_TYPE_NON_MEDIA; @@ -510,7 +511,7 @@ class StateControllerImplTest : public ::testing::Test { am::HmiStatePtr second_hmi_state, ApplicationType app_t, void (StateControllerImplTest::*call_back)(std::vector<am::HmiStatePtr>&, - ApplicationType)) { + ApplicationType)) { InsertApplication(app); std::vector<am::HmiStatePtr> result_hmi_state; (this->*call_back)(result_hmi_state, app_t); @@ -533,12 +534,13 @@ class StateControllerImplTest : public ::testing::Test { first_hmi_state->set_parent(*it_begin); second_hmi_state->set_parent(first_hmi_state); HmiStatesComparator st_comp(second_hmi_state); - ASSERT_TRUE(st_comp(*it_result_begin)) << second_hmi_state->audio_streaming_state() << "." - << second_hmi_state->hmi_level() << "." - << second_hmi_state->system_context() << "_" - << (*it_result_begin)->audio_streaming_state() << "." - << (*it_result_begin)->hmi_level() << "." - << (*it_result_begin)->system_context() << "_"; + ASSERT_TRUE(st_comp(*it_result_begin)) + << second_hmi_state->audio_streaming_state() << "." + << second_hmi_state->hmi_level() << "." + << second_hmi_state->system_context() << "_" + << (*it_result_begin)->audio_streaming_state() << "." + << (*it_result_begin)->hmi_level() << "." + << (*it_result_begin)->system_context() << "_"; } } @@ -568,11 +570,12 @@ class StateControllerImplTest : public ::testing::Test { } protected: - am::ApplicationSharedPtr ConfigureApp(NiceMock<application_manager_test::MockApplication>** app_mock, - uint32_t app_id, - bool media, - bool navi, - bool vc) { + am::ApplicationSharedPtr ConfigureApp( + NiceMock<application_manager_test::MockApplication>** app_mock, + uint32_t app_id, + bool media, + bool navi, + bool vc) { *app_mock = new NiceMock<application_manager_test::MockApplication>; Mock::AllowLeak(*app_mock); // WorkAround for gogletest bug @@ -829,7 +832,8 @@ class StateControllerImplTest : public ::testing::Test { } virtual void SetUp() OVERRIDE { - ON_CALL(app_manager_mock_, event_dispatcher()).WillByDefault(ReturnRef(mock_event_dispatcher_)); + ON_CALL(app_manager_mock_, event_dispatcher()) + .WillByDefault(ReturnRef(mock_event_dispatcher_)); state_ctrl_ = utils::MakeShared<am::StateControllerImpl>(app_manager_mock_); ON_CALL(app_manager_mock_, applications()) @@ -851,27 +855,31 @@ class StateControllerImplTest : public ::testing::Test { .WillByDefault(ReturnRef(*conn_handler)); } - void SetBCActivateAppRequestToHMI(const hmi_apis::Common_HMILevel::eType hmi_lvl, - uint32_t corr_id) { - ON_CALL(mock_connection_handler_,get_session_observer()).WillByDefault(ReturnRef(mock_session_observer_)); - ON_CALL(app_manager_mock_,connection_handler()).WillByDefault(ReturnRef(mock_connection_handler_)); - ON_CALL(app_manager_mock_,GetPolicyHandler()).WillByDefault(ReturnRef(policy_interface_)); + void SetBCActivateAppRequestToHMI( + const hmi_apis::Common_HMILevel::eType hmi_lvl, uint32_t corr_id) { + ON_CALL(mock_connection_handler_, get_session_observer()) + .WillByDefault(ReturnRef(mock_session_observer_)); + ON_CALL(app_manager_mock_, connection_handler()) + .WillByDefault(ReturnRef(mock_connection_handler_)); + ON_CALL(app_manager_mock_, GetPolicyHandler()) + .WillByDefault(ReturnRef(policy_interface_)); smart_objects::SmartObjectSPtr bc_activate_app_request = new smart_objects::SmartObject(); (*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_, ManageHMICommand(bc_activate_app_request)) .WillByDefault(Return(true)); } - void ExpectSuccesfullSetHmiState(am::ApplicationSharedPtr app, - NiceMock<application_manager_test::MockApplication>* app_mock, - am::HmiStatePtr old_state, - am::HmiStatePtr new_state) { + void ExpectSuccesfullSetHmiState( + am::ApplicationSharedPtr app, + NiceMock<application_manager_test::MockApplication>* app_mock, + am::HmiStatePtr old_state, + am::HmiStatePtr new_state) { EXPECT_CALL(*app_mock, CurrentHmiState()) .WillOnce(Return(old_state)) .WillOnce(Return(new_state)); @@ -1063,8 +1071,8 @@ TEST_F(StateControllerImplTest, OnStateChangedWithEqualStates) { for (uint32_t i = 0; i < valid_states_for_not_audio_app_.size(); ++i) { state_ctrl_->OnStateChanged(simple_app_, - valid_states_for_not_audio_app_[i], - valid_states_for_not_audio_app_[i]); + valid_states_for_not_audio_app_[i], + valid_states_for_not_audio_app_[i]); } } @@ -1086,8 +1094,8 @@ TEST_F(StateControllerImplTest, OnStateChangedWithDifferentStates) { EXPECT_CALL(*simple_app_ptr_, ResetDataInNone()).Times(1); } state_ctrl_->OnStateChanged(simple_app_, - valid_states_for_not_audio_app_[i], - valid_states_for_not_audio_app_[j]); + valid_states_for_not_audio_app_[i], + valid_states_for_not_audio_app_[j]); EXPECT_CALL(app_manager_mock_, SendHMIStatusNotification(_)).Times(0); EXPECT_CALL(app_manager_mock_, OnHMILevelChanged(_, _, _)).Times(0); @@ -1150,7 +1158,8 @@ TEST_F(StateControllerImplTest, MoveAudioNotResumeAppToValidStates) { namespace SystemContext = mobile_apis::SystemContext; am::ApplicationSharedPtr audio_app = media_navi_vc_app_; - NiceMock<application_manager_test::MockApplication>* audio_app_mock = media_navi_vc_app_ptr_; + NiceMock<application_manager_test::MockApplication>* audio_app_mock = + media_navi_vc_app_ptr_; HmiStatePtr initial_state = createHmiState(HMILevel::INVALID_ENUM, AudioStreamingState::INVALID_ENUM, @@ -1183,7 +1192,8 @@ TEST_F(StateControllerImplTest, MoveAudioResumeAppToValidStates) { namespace SystemContext = mobile_apis::SystemContext; am::ApplicationSharedPtr audio_app = media_navi_vc_app_; - NiceMock<application_manager_test::MockApplication>* audio_app_mock = media_navi_vc_app_ptr_; + NiceMock<application_manager_test::MockApplication>* audio_app_mock = + media_navi_vc_app_ptr_; HmiStatePtr initial_state = createHmiState(HMILevel::INVALID_ENUM, AudioStreamingState::INVALID_ENUM, @@ -1259,7 +1269,8 @@ TEST_F(StateControllerImplTest, MoveAppFromValidStateToInvalid) { } } -TEST_F(StateControllerImplTest, SetFullToSimpleAppWhileAnotherSimpleAppIsInFull) { +TEST_F(StateControllerImplTest, + SetFullToSimpleAppWhileAnotherSimpleAppIsInFull) { namespace HMILevel = mobile_apis::HMILevel; namespace AudioStreamingState = mobile_apis::AudioStreamingState; namespace SystemContext = mobile_apis::SystemContext; @@ -1293,10 +1304,12 @@ TEST_F(StateControllerImplTest, SetFullToSimpleAppWhileAudioAppAppIsInFull) { namespace AudioStreamingState = mobile_apis::AudioStreamingState; namespace SystemContext = mobile_apis::SystemContext; am::ApplicationSharedPtr app_in_full = media_navi_vc_app_; - NiceMock<application_manager_test::MockApplication>* app_in_full_mock = media_navi_vc_app_ptr_; + NiceMock<application_manager_test::MockApplication>* app_in_full_mock = + media_navi_vc_app_ptr_; am::ApplicationSharedPtr app_moved_to_full = simple_app_; - NiceMock<application_manager_test::MockApplication>* app_moved_to_full_mock = simple_app_ptr_; + NiceMock<application_manager_test::MockApplication>* app_moved_to_full_mock = + simple_app_ptr_; InsertApplication(app_in_full); InsertApplication(app_moved_to_full); @@ -1318,10 +1331,12 @@ TEST_F(StateControllerImplTest, namespace SystemContext = mobile_apis::SystemContext; am::ApplicationSharedPtr app_in_full = media_app_; - NiceMock<application_manager_test::MockApplication>* app_in_full_mock = media_app_ptr_; + NiceMock<application_manager_test::MockApplication>* app_in_full_mock = + media_app_ptr_; am::ApplicationSharedPtr app_moved_to_full = navi_app_; - NiceMock<application_manager_test::MockApplication>* app_moved_to_full_mock = navi_app_ptr_; + NiceMock<application_manager_test::MockApplication>* app_moved_to_full_mock = + navi_app_ptr_; InsertApplication(app_in_full); InsertApplication(app_moved_to_full); @@ -1398,7 +1413,8 @@ TEST_F(StateControllerImplTest, am::ApplicationSharedPtr app_in_limited = ConfigureApp(&app_in_limited_mock, 1761, NOT_MEDIA, NOT_NAVI, VC); - NiceMock<application_manager_test::MockApplication>* app_moved_to_limited_mock; + 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); @@ -1423,10 +1439,12 @@ TEST_F(StateControllerImplTest, namespace SystemContext = mobile_apis::SystemContext; am::ApplicationSharedPtr app_in_limited = navi_app_; - NiceMock<application_manager_test::MockApplication>* app_in_limited_mock = navi_app_ptr_; + NiceMock<application_manager_test::MockApplication>* app_in_limited_mock = + navi_app_ptr_; am::ApplicationSharedPtr app_moved_to_limited = vc_app_; - NiceMock<application_manager_test::MockApplication>* app_moved_to_limited_mock = vc_app_ptr_; + NiceMock<application_manager_test::MockApplication>* + app_moved_to_limited_mock = vc_app_ptr_; InsertApplication(app_in_limited); InsertApplication(app_moved_to_limited); @@ -1445,10 +1463,12 @@ TEST_F(StateControllerImplTest, namespace AudioStreamingState = mobile_apis::AudioStreamingState; namespace SystemContext = mobile_apis::SystemContext; am::ApplicationSharedPtr app_in_full = navi_app_; - NiceMock<application_manager_test::MockApplication>* app_in_full_mock = navi_app_ptr_; + NiceMock<application_manager_test::MockApplication>* app_in_full_mock = + navi_app_ptr_; am::ApplicationSharedPtr app_moved_to_limited = vc_app_; - NiceMock<application_manager_test::MockApplication>* app_moved_to_limited_mock = vc_app_ptr_; + NiceMock<application_manager_test::MockApplication>* + app_moved_to_limited_mock = vc_app_ptr_; InsertApplication(app_in_full); InsertApplication(app_moved_to_limited); @@ -1469,13 +1489,16 @@ TEST_F(StateControllerImplTest, SetFullToSimpleAppWhile2AudioAppsInLimited) { namespace SystemContext = mobile_apis::SystemContext; am::ApplicationSharedPtr app_moved_to_full = simple_app_; - NiceMock<application_manager_test::MockApplication>* app_moved_to_full_mock = simple_app_ptr_; + NiceMock<application_manager_test::MockApplication>* app_moved_to_full_mock = + simple_app_ptr_; am::ApplicationSharedPtr limited_app1 = media_app_; - NiceMock<application_manager_test::MockApplication>* limited_app1_mock = media_app_ptr_; + NiceMock<application_manager_test::MockApplication>* limited_app1_mock = + media_app_ptr_; am::ApplicationSharedPtr limited_app2 = navi_vc_app_; - NiceMock<application_manager_test::MockApplication>* limited_app2_mock = navi_vc_app_ptr_; + NiceMock<application_manager_test::MockApplication>* limited_app2_mock = + navi_vc_app_ptr_; InsertApplication(app_moved_to_full); InsertApplication(limited_app1); @@ -1501,13 +1524,16 @@ TEST_F(StateControllerImplTest, namespace SystemContext = mobile_apis::SystemContext; am::ApplicationSharedPtr app_moved_to_full = simple_app_; - NiceMock<application_manager_test::MockApplication>* app_moved_to_full_mock = simple_app_ptr_; + NiceMock<application_manager_test::MockApplication>* app_moved_to_full_mock = + simple_app_ptr_; am::ApplicationSharedPtr limited_app = media_app_; - NiceMock<application_manager_test::MockApplication>* limited_app_mock = media_app_ptr_; + NiceMock<application_manager_test::MockApplication>* limited_app_mock = + media_app_ptr_; am::ApplicationSharedPtr full_app = navi_vc_app_; - NiceMock<application_manager_test::MockApplication>* full_app_mock = navi_vc_app_ptr_; + NiceMock<application_manager_test::MockApplication>* full_app_mock = + navi_vc_app_ptr_; InsertApplication(app_moved_to_full); InsertApplication(limited_app); @@ -1538,7 +1564,8 @@ TEST_F(StateControllerImplTest, ConfigureApp(&app_moved_to_full_mock, 1761, NOT_MEDIA, NOT_NAVI, NOT_VC); am::ApplicationSharedPtr limited_app = media_app_; - NiceMock<application_manager_test::MockApplication>* limited_app_mock = media_app_ptr_; + NiceMock<application_manager_test::MockApplication>* limited_app_mock = + media_app_ptr_; NiceMock<application_manager_test::MockApplication>* full_app_mock; am::ApplicationSharedPtr full_app = @@ -1717,25 +1744,25 @@ TEST_F(StateControllerImplTest, DISABLED_ActivateAppSuccessReceivedFromHMI) { am::HmiStatePtr initial_hmi_state = it->first; Common_HMILevel::eType hmi_level = it->second; - SetBCActivateAppRequestToHMI(hmi_level, corr_id); - ON_CALL(app_manager_mock_, ManageHMICommand(bc_activate_app_request)) - .WillByDefault(Return(true)); - - EXPECT_CALL(app_manager_mock_, application_id(corr_id)) - .WillOnce(Return(hmi_app_id)); - EXPECT_CALL(app_manager_mock_, application_by_hmi_app(hmi_app_id)) - .WillOnce(Return(media_app_)); - ExpectSuccesfullSetHmiState( - media_app_, media_app_ptr_, initial_hmi_state, hmi_state); - state_ctrl_->SetRegularState(media_app_, hmi_state, true); - smart_objects::SmartObject message; - message[am::strings::params][am::hmi_response::code] = - Common_Result::SUCCESS; - message[am::strings::params][am::strings::correlation_id] = corr_id; - am::event_engine::Event event( - hmi_apis::FunctionID::BasicCommunication_ActivateApp); - event.set_smart_object(message); - state_ctrl_->on_event(event); + SetBCActivateAppRequestToHMI(hmi_level, corr_id); + ON_CALL(app_manager_mock_, ManageHMICommand(bc_activate_app_request)) + .WillByDefault(Return(true)); + + EXPECT_CALL(app_manager_mock_, application_id(corr_id)) + .WillOnce(Return(hmi_app_id)); + EXPECT_CALL(app_manager_mock_, application_by_hmi_app(hmi_app_id)) + .WillOnce(Return(media_app_)); + ExpectSuccesfullSetHmiState( + media_app_, media_app_ptr_, initial_hmi_state, hmi_state); + state_ctrl_->SetRegularState(media_app_, hmi_state, true); + smart_objects::SmartObject message; + message[am::strings::params][am::hmi_response::code] = + Common_Result::SUCCESS; + message[am::strings::params][am::strings::correlation_id] = corr_id; + am::event_engine::Event event( + hmi_apis::FunctionID::BasicCommunication_ActivateApp); + event.set_smart_object(message); + state_ctrl_->on_event(event); } } @@ -1955,7 +1982,8 @@ TEST_F(StateControllerImplTest, &StateControllerImplTest::PrepareVRTTSHMIStateResults); } -TEST_F(StateControllerImplTest, SetTTSStateForMediaApplicationAttenuatedSupported) { +TEST_F(StateControllerImplTest, + SetTTSStateForMediaApplicationAttenuatedSupported) { am::HmiStatePtr state_tts = utils::MakeShared<am::TTSHmiState>(media_app_id_, app_manager_mock_); EXPECT_CALL(app_manager_mock_, is_attenuated_supported()) @@ -2090,7 +2118,8 @@ TEST_F(StateControllerImplTest, SetSafetyModeStateForMediaApplication) { &StateControllerImplTest::PrepareVRTTSHMIStateResults); } -TEST_F(StateControllerImplTest, SetSafetyModeStateForMediaNaviVoiceApplication) { +TEST_F(StateControllerImplTest, + SetSafetyModeStateForMediaNaviVoiceApplication) { am::HmiStatePtr state_safety_mode = utils::MakeShared<am::VRHmiState>( media_navi_vc_app_id_, app_manager_mock_); TestSetState(media_navi_vc_app_, @@ -2129,7 +2158,8 @@ TEST_F(StateControllerImplTest, &StateControllerImplTest::PreparePhoneCallHMIStateResults); } -TEST_F(StateControllerImplTest, MixNaviStreamingWithPhoneCallAttenuatedSupported) { +TEST_F(StateControllerImplTest, + MixNaviStreamingWithPhoneCallAttenuatedSupported) { EXPECT_CALL(app_manager_mock_, is_attenuated_supported()) .WillRepeatedly(Return(true)); @@ -2179,7 +2209,8 @@ TEST_F(StateControllerImplTest, MixSafetyModeStreamingWithVR) { &StateControllerImplTest::PrepareVRTTSHMIStateResults); } -TEST_F(StateControllerImplTest, MixNaviStreamingWithTTSAttenueatedNotSupported) { +TEST_F(StateControllerImplTest, + MixNaviStreamingWithTTSAttenueatedNotSupported) { EXPECT_CALL(app_manager_mock_, is_attenuated_supported()) .WillRepeatedly(Return(false)); @@ -2256,7 +2287,8 @@ TEST_F(StateControllerImplTest, SetRegularStateWithNewHmiLvl) { .WillOnce(Return(BackgroundState())); const uint32_t corr_id = 314; - SetBCActivateAppRequestToHMI(static_cast<hmi_apis::Common_HMILevel::eType>(set_lvl), corr_id); + SetBCActivateAppRequestToHMI( + static_cast<hmi_apis::Common_HMILevel::eType>(set_lvl), corr_id); state_ctrl_->SetRegularState(simple_app_, set_lvl); diff --git a/src/components/application_manager/test/usage_statistics_test.cc b/src/components/application_manager/test/usage_statistics_test.cc index 88406e02e9..b5d1da0992 100644 --- a/src/components/application_manager/test/usage_statistics_test.cc +++ b/src/components/application_manager/test/usage_statistics_test.cc @@ -77,8 +77,7 @@ class UsageStatisticsTest : public testing::Test { , language_(LanguageIdToString(kTestLanguageId)) {} protected: - utils::SharedPtr<MockStatisticsManager> - mock_statistics_manager_sptr_; + utils::SharedPtr<MockStatisticsManager> mock_statistics_manager_sptr_; std::auto_ptr<application_manager::UsageStatistics> usage_statistics_test_object1_sptr_; const std::string language_; @@ -86,7 +85,8 @@ class UsageStatisticsTest : public testing::Test { TEST_F(UsageStatisticsTest, RecordHmiStateChanged_CallMethod_ExpectMethodCall) { // Arrange - std::auto_ptr<MockAppStopwatch> mock_app_stopwatch_object(new MockAppStopwatch); + std::auto_ptr<MockAppStopwatch> mock_app_stopwatch_object( + new MockAppStopwatch); // Checks EXPECT_CALL(*mock_app_stopwatch_object, Start(kTestAppStopwatchId)); 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 2cc85314be..0f52639575 100644 --- a/src/components/application_manager/test/zero_request_amount_test.cc +++ b/src/components/application_manager/test/zero_request_amount_test.cc @@ -54,28 +54,30 @@ using namespace application_manager; using namespace NsSmartDeviceLink::NsSmartObjects; commands::Command* RegisterApplication() { - - SmartObjectSPtr resultsmart = application_manager::MessageHelper::CreateModuleInfoSO(1); + SmartObjectSPtr resultsmart = + application_manager::MessageHelper::CreateModuleInfoSO(1); SmartObject& test_message = *resultsmart; uint32_t connection_key = 0; test_message[strings::params][strings::connection_key] = connection_key; test_message[strings::msg_params][strings::language_desired] = 0; test_message[strings::msg_params][strings::hmi_display_language_desired] = 0; - commands::Command* testregCommand = new commands::RegisterAppInterfaceRequest(resultsmart); + commands::Command* testregCommand = + new commands::RegisterAppInterfaceRequest(resultsmart); return testregCommand; } commands::Command* UnregisterApplication() { - SmartObjectSPtr resultsmart = application_manager::MessageHelper::CreateModuleInfoSO(2); - commands::Command *testregCommand = + SmartObjectSPtr resultsmart = + application_manager::MessageHelper::CreateModuleInfoSO(2); + commands::Command* testregCommand = new commands::UnregisterAppInterfaceRequest(resultsmart); return testregCommand; } -commands::Command* PutFileCommand(uint32_t &correlation_id, - uint32_t &connection_key) { - - SmartObjectSPtr resultsmart = application_manager::MessageHelper::CreateModuleInfoSO(32); +commands::Command* PutFileCommand(uint32_t& correlation_id, + uint32_t& connection_key) { + SmartObjectSPtr resultsmart = + application_manager::MessageHelper::CreateModuleInfoSO(32); SmartObject& test_message = *resultsmart; test_message[strings::params][strings::correlation_id] = correlation_id; test_message[strings::params][strings::connection_key] = connection_key; @@ -89,68 +91,70 @@ commands::Command* PutFileCommand(uint32_t &correlation_id, TEST(RequestControlTest, ZeroValuePendingRequestsAmount) { // Default value - const uint32_t big_count_of_requests_for_test_ = 10; //bigger than pending_requests_amount + const uint32_t big_count_of_requests_for_test_ = + 10; // bigger than pending_requests_amount uint32_t correlation_id = 0; uint32_t connection_key = 0; RequestController::TResult result; RequestController request_ctrl_; - commands::Command * reg = RegisterApplication(); + commands::Command* reg = RegisterApplication(); request_ctrl_.addMobileRequest(reg, mobile_apis::HMILevel::HMI_FULL); for (uint32_t i = 0; i < big_count_of_requests_for_test_; ++i) { correlation_id = i; - commands::Command* testCommand = PutFileCommand(correlation_id, - connection_key); + commands::Command* testCommand = + PutFileCommand(correlation_id, connection_key); result = request_ctrl_.addMobileRequest(testCommand, mobile_apis::HMILevel::HMI_FULL); EXPECT_EQ(RequestController::SUCCESS, result); } - commands::Command * unreg = UnregisterApplication(); + commands::Command* unreg = UnregisterApplication(); request_ctrl_.addMobileRequest(unreg, mobile_apis::HMILevel::HMI_FULL); } TEST(RequestControlTest, ZeroValueAppRequestsTimeScale) { // Default value - const uint32_t big_count_of_requests_for_test_ = 10; //bigger than pending_requests_amount + const uint32_t big_count_of_requests_for_test_ = + 10; // bigger than pending_requests_amount uint32_t correlation_id = 0; uint32_t connection_key = 0; RequestController::TResult result; RequestController request_ctrl_; - commands::Command * reg = RegisterApplication(); + commands::Command* reg = RegisterApplication(); request_ctrl_.addMobileRequest(reg, mobile_apis::HMILevel::HMI_FULL); for (uint32_t i = 0; i < big_count_of_requests_for_test_; ++i) { correlation_id = i; - commands::Command * testCommand = PutFileCommand(correlation_id, - connection_key); + commands::Command* testCommand = + PutFileCommand(correlation_id, connection_key); result = request_ctrl_.addMobileRequest(testCommand, mobile_apis::HMILevel::HMI_FULL); EXPECT_EQ(RequestController::SUCCESS, result); } - commands::Command* unreg = UnregisterApplication(); request_ctrl_.addMobileRequest(unreg, mobile_apis::HMILevel::HMI_FULL); } TEST(RequestControlTest, ZeroValueAppTimeScaleMaxRequests) { // Default value - const uint32_t big_count_of_requests_for_test_ = 10; //bigger than pending_requests_amount + const uint32_t big_count_of_requests_for_test_ = + 10; // bigger than pending_requests_amount uint32_t correlation_id = 0; uint32_t connection_key = 0; RequestController::TResult result; RequestController request_ctrl_; - commands::Command * reg = RegisterApplication(); + commands::Command* reg = RegisterApplication(); request_ctrl_.addMobileRequest(reg, mobile_apis::HMILevel::HMI_FULL); for (uint32_t i = 0; i < big_count_of_requests_for_test_; ++i) { correlation_id = i; - commands::Command* testCommand = PutFileCommand(correlation_id, - connection_key); + commands::Command* testCommand = + PutFileCommand(correlation_id, connection_key); result = request_ctrl_.addMobileRequest(testCommand, mobile_apis::HMILevel::HMI_FULL); EXPECT_EQ(RequestController::SUCCESS, result); diff --git a/src/components/config_profile/include/config_profile/profile.h b/src/components/config_profile/include/config_profile/profile.h index 8e52a330a4..5abf8a9f78 100644 --- a/src/components/config_profile/include/config_profile/profile.h +++ b/src/components/config_profile/include/config_profile/profile.h @@ -88,219 +88,219 @@ class Profile : public protocol_handler::ProtocolHandlerSettings, */ bool launch_hmi() const OVERRIDE; #ifdef WEB_HMI - /** - * @brief Returns link to web hmi - */ - std::string link_to_web_hmi() const; -#endif // WEB_HMI - /** - * @brief Returns application configuration path - */ - const std::string& app_config_folder() const; - - /** - * @brief Returns application storage path - */ - const std::string& app_storage_folder() const; - - /** - * @brief Return application resourse folder - */ - const std::string& app_resource_folder() const; - - /** - * @brief Returns true, if SDL 4.0 is enabled - */ - bool enable_protocol_4() const OVERRIDE; - - /** - * @brief Returns application icons folder path - */ - const std::string& app_icons_folder() const OVERRIDE; - - /** - * @brief Returns application icons folder maximum size - */ - const uint32_t& app_icons_folder_max_size() const OVERRIDE; - - /** - * @brief Returns application icons amount to remove from icon folder, - * if maximum size exceeded - */ - const uint32_t& app_icons_amount_to_remove() const OVERRIDE; - - /** - * @brief Returns the path to the config file - */ - const std::string& config_file_name() const; - - /** - * @brief Sets the path to the config file - */ - void config_file_name(const std::string& fileName); - - /** - * @brief Returns server address - */ - const std::string& server_address() const; - - /** - * @brief Returns server port - */ - const uint16_t& server_port() const; - - /** - * @brief Returns port for video streaming - */ - const uint16_t video_streaming_port() const OVERRIDE; - - /** - * @brief Returns port for audio streaming - */ - const uint16_t audio_streaming_port() const; - - /** - * @brief Returns streaming timeout - */ - uint32_t stop_streaming_timeout() const; - - /** - * @brief Returns port for time reports - */ - const uint16_t& time_testing_port() const; - - /** - * @brief Returns hmi capabilities file name - */ - const std::string& hmi_capabilities_file_name() const; - - /** - * @brief Returns help promt vector - */ - const std::vector<std::string>& help_prompt() const; - - /** - * @brief Returns help promt vector - */ - const std::vector<std::string>& time_out_promt() const; - - /** - * @brief Returns vr commands default for all apps - * such as Help. - */ - const std::vector<std::string>& vr_commands() const; - - /** - * @brief Maximum command id available for mobile app - */ - const uint32_t& max_cmd_id() const; - - /** - * @brief Default timeout for waiting for response to mobile app - */ - const uint32_t& default_timeout() const; - - /** - * @brief Default timeout for waiting for resuming - */ - const uint32_t& app_resuming_timeout() const; - const uint32_t& app_resumption_save_persistent_data_timeout() const; - - /** - * @brief Returns desirable thread stack size - */ - const uint64_t& thread_min_stack_size() const; - - /** - * @brief Returns true if audio mixing is supported - */ - bool is_mixing_audio_supported() const; - - /** - * @brief Returns true if video re-decoding enabled - */ - bool is_redecoding_enabled() const; - - /** - * @brief Returns title for Vr Help - */ - const std::string& vr_help_title() const; - - /** - * @brief Returns application directory quota size - */ - const uint32_t& app_dir_quota() const; - - /** - * @brief Returns the video server type - */ - const std::string& video_server_type() const; - - /** - * @brief Returns the audio server type - */ - const std::string& audio_server_type() const; - - /** - * @brief Returns the video pipe path - */ - const std::string& named_video_pipe_path() const; - - /** - * @brief Returns the audio pipe path - */ - const std::string& named_audio_pipe_path() const; - - /** - * @brief Returns time scale for max amount of requests for application - * in hmi level none. - */ - const uint32_t& app_hmi_level_none_time_scale() const; - - /** - * @brief Returns path to testing file to which redirects video stream - */ - const std::string& video_stream_file() const; - - /** - * @brief Returns path to testing file to which redirects audio stream - */ - const std::string& audio_stream_file() const; - - /** - * @brief Returns timeout for SDL to wait for the next package of raw data - * over audio service - */ - const std::uint32_t audio_data_stopped_timeout() const; - - /** - * @brief Returns timeout for SDL to wait for the next package of raw data - * over video service - */ - const std::uint32_t video_data_stopped_timeout() const; - - /** - * @brief Returns allowable max amount of requests per time scale for - * application in hmi level none - * - */ - const uint32_t& app_hmi_level_none_time_scale_max_requests() const; - - /** - * @brief Returns application time scale for max amount of requests per it. - */ - const uint32_t& app_time_scale() const; - - /** - * @brief Returns allowable max amount of requests per application - * time scale - */ - const uint32_t& app_time_scale_max_requests() const; - - /** - * @brief Returns allowable amount of the system pending requests - */ - const uint32_t& pending_requests_amount() const; + /** + * @brief Returns link to web hmi + */ + std::string link_to_web_hmi() const; +#endif // WEB_HMI + /** + * @brief Returns application configuration path + */ + const std::string& app_config_folder() const; + + /** + * @brief Returns application storage path + */ + const std::string& app_storage_folder() const; + + /** + * @brief Return application resourse folder + */ + const std::string& app_resource_folder() const; + + /** + * @brief Returns true, if SDL 4.0 is enabled + */ + bool enable_protocol_4() const OVERRIDE; + + /** + * @brief Returns application icons folder path + */ + const std::string& app_icons_folder() const OVERRIDE; + + /** + * @brief Returns application icons folder maximum size + */ + const uint32_t& app_icons_folder_max_size() const OVERRIDE; + + /** + * @brief Returns application icons amount to remove from icon folder, + * if maximum size exceeded + */ + const uint32_t& app_icons_amount_to_remove() const OVERRIDE; + + /** + * @brief Returns the path to the config file + */ + const std::string& config_file_name() const; + + /** + * @brief Sets the path to the config file + */ + void config_file_name(const std::string& fileName); + + /** + * @brief Returns server address + */ + const std::string& server_address() const; + + /** + * @brief Returns server port + */ + const uint16_t& server_port() const; + + /** + * @brief Returns port for video streaming + */ + const uint16_t video_streaming_port() const OVERRIDE; + + /** + * @brief Returns port for audio streaming + */ + const uint16_t audio_streaming_port() const; + + /** + * @brief Returns streaming timeout + */ + uint32_t stop_streaming_timeout() const; + + /** + * @brief Returns port for time reports + */ + const uint16_t& time_testing_port() const; + + /** + * @brief Returns hmi capabilities file name + */ + const std::string& hmi_capabilities_file_name() const; + + /** + * @brief Returns help promt vector + */ + const std::vector<std::string>& help_prompt() const; + + /** + * @brief Returns help promt vector + */ + const std::vector<std::string>& time_out_promt() const; + + /** + * @brief Returns vr commands default for all apps + * such as Help. + */ + const std::vector<std::string>& vr_commands() const; + + /** + * @brief Maximum command id available for mobile app + */ + const uint32_t& max_cmd_id() const; + + /** + * @brief Default timeout for waiting for response to mobile app + */ + const uint32_t& default_timeout() const; + + /** + * @brief Default timeout for waiting for resuming + */ + const uint32_t& app_resuming_timeout() const; + const uint32_t& app_resumption_save_persistent_data_timeout() const; + + /** + * @brief Returns desirable thread stack size + */ + const uint64_t& thread_min_stack_size() const; + + /** + * @brief Returns true if audio mixing is supported + */ + bool is_mixing_audio_supported() const; + + /** + * @brief Returns true if video re-decoding enabled + */ + bool is_redecoding_enabled() const; + + /** + * @brief Returns title for Vr Help + */ + const std::string& vr_help_title() const; + + /** + * @brief Returns application directory quota size + */ + const uint32_t& app_dir_quota() const; + + /** + * @brief Returns the video server type + */ + const std::string& video_server_type() const; + + /** + * @brief Returns the audio server type + */ + const std::string& audio_server_type() const; + + /** + * @brief Returns the video pipe path + */ + const std::string& named_video_pipe_path() const; + + /** + * @brief Returns the audio pipe path + */ + const std::string& named_audio_pipe_path() const; + + /** + * @brief Returns time scale for max amount of requests for application + * in hmi level none. + */ + const uint32_t& app_hmi_level_none_time_scale() const; + + /** + * @brief Returns path to testing file to which redirects video stream + */ + const std::string& video_stream_file() const; + + /** + * @brief Returns path to testing file to which redirects audio stream + */ + const std::string& audio_stream_file() const; + + /** + * @brief Returns timeout for SDL to wait for the next package of raw data + * over audio service + */ + const std::uint32_t audio_data_stopped_timeout() const; + + /** + * @brief Returns timeout for SDL to wait for the next package of raw data + * over video service + */ + const std::uint32_t video_data_stopped_timeout() const; + + /** + * @brief Returns allowable max amount of requests per time scale for + * application in hmi level none + * + */ + const uint32_t& app_hmi_level_none_time_scale_max_requests() const; + + /** + * @brief Returns application time scale for max amount of requests per it. + */ + const uint32_t& app_time_scale() const; + + /** + * @brief Returns allowable max amount of requests per application + * time scale + */ + const uint32_t& app_time_scale_max_requests() const; + + /** + * @brief Returns allowable amount of the system pending requests + */ + const uint32_t& pending_requests_amount() const; /** * @brief Returns Max allowed number of PutFile requests for one @@ -430,83 +430,82 @@ class Profile : public protocol_handler::ProtocolHandlerSettings, */ size_t update_before_hours() const; -#endif //ENABLE_SECURITY - /** - * @brief Reads a string value from the profile - * - * @param value Result value - * @param default_value Value to use key wasn't found - * @param pSection The section to read the value in - * @param pKey The key whose value needs to be read out - * - * @return FALSE if could not read the value out of the profile - * (then the value is equal \c default_value) - */ - bool ReadStringValue(std::string* value, - const char* default_value, - const char* const pSection, - const char* const pKey) const; - - /** - * @brief Reads an int32_t value from the profile - * - * @param value Result value - * @param default_value Value to use key wasn't found - * @param pSection The section to read the value in - * @param pKey The key whose value needs to be read out - * - * @return FALSE if could not read the value out of the profile - * (then the value is equal \c default_value) - */ - bool ReadIntValue(int32_t* value, - int32_t default_value, - const char* const pSection, - const char* const pKey) const; - /** - * @brief Reads an bool value from the profile - * - * @param value Result value - * @param default_value Value to use key wasn't found - * @param pSection The section to read the value in - * @param pKey The key whose value needs to be read out - * - * @return FALSE if could not read the value out of the profile - * (then the value is equal \c default_value) - */ - bool ReadBoolValue(bool *value, - const bool default_value, - const char * const pSection, - const char * const pKey) const; - /** - * @brief Reads an container of string values from the profile, - * which handle as "Value1, Value2, Value3" - * - * @param pSection The section to read the value in - * @param pKey The key whose value needs to be read out - * @param out_result Pointer to bool value for result reading Section - * (could be NULL) - * - * @return container of values or empty continer - * if could not read the value out of the profile - */ - std::vector<std::string> ReadStringContainer( - const char * const pSection, - const char * const pKey, - bool* out_result) const; - /** - * @brief Reads an container of hex int values from the profile, - * which handle as "0x01, 0xA0, 0XFF" - * - * @param pSection The section to read the value in - * @param pKey The key whose value needs to be read out - * @param out_result Pointer to bool value for result reading Section - * (could be NULL) - * - * @return container of values or empty continer - * if could not read the value out of the profile - */ - std::vector<int> ReadIntContainer(const char * const pSection, - const char * const pKey, +#endif // ENABLE_SECURITY + /** + * @brief Reads a string value from the profile + * + * @param value Result value + * @param default_value Value to use key wasn't found + * @param pSection The section to read the value in + * @param pKey The key whose value needs to be read out + * + * @return FALSE if could not read the value out of the profile + * (then the value is equal \c default_value) + */ + bool ReadStringValue(std::string* value, + const char* default_value, + const char* const pSection, + const char* const pKey) const; + + /** + * @brief Reads an int32_t value from the profile + * + * @param value Result value + * @param default_value Value to use key wasn't found + * @param pSection The section to read the value in + * @param pKey The key whose value needs to be read out + * + * @return FALSE if could not read the value out of the profile + * (then the value is equal \c default_value) + */ + bool ReadIntValue(int32_t* value, + int32_t default_value, + const char* const pSection, + const char* const pKey) const; + /** + * @brief Reads an bool value from the profile + * + * @param value Result value + * @param default_value Value to use key wasn't found + * @param pSection The section to read the value in + * @param pKey The key whose value needs to be read out + * + * @return FALSE if could not read the value out of the profile + * (then the value is equal \c default_value) + */ + bool ReadBoolValue(bool* value, + const bool default_value, + const char* const pSection, + const char* const pKey) const; + /** + * @brief Reads an container of string values from the profile, + * which handle as "Value1, Value2, Value3" + * + * @param pSection The section to read the value in + * @param pKey The key whose value needs to be read out + * @param out_result Pointer to bool value for result reading Section + * (could be NULL) + * + * @return container of values or empty continer + * if could not read the value out of the profile + */ + std::vector<std::string> ReadStringContainer(const char* const pSection, + const char* const pKey, + bool* out_result) const; + /** + * @brief Reads an container of hex int values from the profile, + * which handle as "0x01, 0xA0, 0XFF" + * + * @param pSection The section to read the value in + * @param pKey The key whose value needs to be read out + * @param out_result Pointer to bool value for result reading Section + * (could be NULL) + * + * @return container of values or empty continer + * if could not read the value out of the profile + */ + std::vector<int> ReadIntContainer(const char* const pSection, + const char* const pKey, bool* out_result) const; /** @@ -522,82 +521,85 @@ class Profile : public protocol_handler::ProtocolHandlerSettings, uint32_t application_list_update_timeout() const OVERRIDE; - /** - * @brief Returns max allowed threads number for handling mobile requests - */ - uint32_t thread_pool_size() const; + /** + * @brief Returns max allowed threads number for handling mobile requests + */ + uint32_t thread_pool_size() const; - /* - * ProtocolHandler section - */ - size_t maximum_payload_size() const OVERRIDE; + /* + * ProtocolHandler section + */ + size_t maximum_payload_size() const OVERRIDE; - size_t message_frequency_count() const OVERRIDE; + size_t message_frequency_count() const OVERRIDE; - size_t message_frequency_time() const OVERRIDE; + size_t message_frequency_time() const OVERRIDE; - bool malformed_message_filtering() const OVERRIDE; + bool malformed_message_filtering() const OVERRIDE; - size_t malformed_frequency_count() const OVERRIDE; + size_t malformed_frequency_count() const OVERRIDE; - size_t malformed_frequency_time() const OVERRIDE; + size_t malformed_frequency_time() const OVERRIDE; - uint32_t multiframe_waiting_timeout() const OVERRIDE; + uint32_t multiframe_waiting_timeout() const OVERRIDE; - uint32_t heart_beat_timeout() const OVERRIDE; + uint32_t heart_beat_timeout() const OVERRIDE; - uint16_t max_supported_protocol_version() const OVERRIDE; + uint16_t max_supported_protocol_version() const OVERRIDE; - #ifdef ENABLE_SECURITY - const std::vector<int>& force_protected_service() const OVERRIDE; +#ifdef ENABLE_SECURITY + const std::vector<int>& force_protected_service() const OVERRIDE; - const std::vector<int>& force_unprotected_service() const OVERRIDE; - #endif // ENABLE_SECURITY - // ProtocolHandler section end + const std::vector<int>& force_unprotected_service() const OVERRIDE; +#endif // ENABLE_SECURITY + // ProtocolHandler section end - uint16_t attempts_to_open_policy_db() const; + uint16_t attempts_to_open_policy_db() const; - uint16_t open_attempt_timeout_ms() const; + uint16_t open_attempt_timeout_ms() const; - uint32_t resumption_delay_before_ign() const; + uint32_t resumption_delay_before_ign() const; - uint32_t resumption_delay_after_ign() const; + uint32_t resumption_delay_after_ign() const; - uint32_t hash_string_size() const; + uint32_t hash_string_size() const; - bool logs_enabled() const; + bool logs_enabled() const; - /** - * @brief Returns true if resumption ctrl uses db, returns false if - * resumption ctrl uses JSON. - */ - bool use_db_for_resumption() const; + /** + * @brief Returns true if resumption ctrl uses db, returns false if + * resumption ctrl uses JSON. + */ + bool use_db_for_resumption() const; - /** - * @brief Returns amount of attempts for opening resumption db - */ - uint16_t attempts_to_open_resumption_db() const; + /** + * @brief Returns amount of attempts for opening resumption db + */ + uint16_t attempts_to_open_resumption_db() const; - /** - * @brief Returns timeout between attempts - */ - uint16_t open_attempt_timeout_ms_resumption_db() const; + /** + * @brief Returns timeout between attempts + */ + uint16_t open_attempt_timeout_ms_resumption_db() const; - /* - * @brief Updates all related values from ini file - */ - void UpdateValues(); + /* + * @brief Updates all related values from ini file + */ + void UpdateValues(); - const uint32_t& list_files_response_size() const OVERRIDE; + const uint32_t& list_files_response_size() const OVERRIDE; - const std::string& recording_file_source() const OVERRIDE; + const std::string& recording_file_source() const OVERRIDE; - const std::pair<uint32_t, int32_t>& read_did_frequency() const OVERRIDE; + const std::pair<uint32_t, int32_t>& read_did_frequency() const OVERRIDE; - const std::pair<uint32_t, int32_t>& get_vehicle_data_frequency() const OVERRIDE; + const std::pair<uint32_t, int32_t>& get_vehicle_data_frequency() + const OVERRIDE; - const std::pair<uint32_t, int32_t>& start_stream_retry_amount() const OVERRIDE; - private: + const std::pair<uint32_t, int32_t>& start_stream_retry_amount() + const OVERRIDE; + + private: /** * @brief Reads a string value from the profile and interpret it * as \c true on "true" value or as \c false on any other value @@ -613,201 +615,201 @@ class Profile : public protocol_handler::ProtocolHandlerSettings, const char* const pSection, const char* const pKey) const; - /** - * @brief Reads a boolean value from the profile - * - * @param value The value to return - * @param pSection The section to read the value in - * @param pKey The key whose value needs to be read out - * - * @return FALSE if could not read the value out of the profile - * (then the value is not changed) - */ - bool ReadValue(bool* value, - const char* const pSection, - const char* const pKey) const; - - /** - * @brief Reads a pair of ints value from the profile - * - * @param value Result value - * @param default_value Value to use key wasn't found - * @param pSection The section to read the value in - * @param pKey The key whose value needs to be read out - * - * @return FALSE if could not read the value out of the profile - * (then the value is not changed) - */ - bool ReadUintIntPairValue(std::pair<uint32_t, int32_t>* value, - const std::pair<uint32_t, uint32_t>& default_value, - const char* const pSection, - const char* const pKey) const; - - /** - * @brief Reads an uint16/32/64_t value from the profile - * - * @param value Result value - * @param default_value Value to use key wasn't found - * @param pSection The section to read the value in - * @param pKey The key whose value needs to be read out - * - * @return FALSE if could not read the value out of the profile - * (then the value is changed to default) - */ - bool ReadUIntValue(uint16_t* value, - uint16_t default_value, - const char* const pSection, - const char* const pKey) const; + /** + * @brief Reads a boolean value from the profile + * + * @param value The value to return + * @param pSection The section to read the value in + * @param pKey The key whose value needs to be read out + * + * @return FALSE if could not read the value out of the profile + * (then the value is not changed) + */ + bool ReadValue(bool* value, + const char* const pSection, + const char* const pKey) const; - bool ReadUIntValue(uint32_t* value, - uint32_t default_value, - const char* const pSection, - const char* const pKey) const; + /** + * @brief Reads a pair of ints value from the profile + * + * @param value Result value + * @param default_value Value to use key wasn't found + * @param pSection The section to read the value in + * @param pKey The key whose value needs to be read out + * + * @return FALSE if could not read the value out of the profile + * (then the value is not changed) + */ + bool ReadUintIntPairValue(std::pair<uint32_t, int32_t>* value, + const std::pair<uint32_t, uint32_t>& default_value, + const char* const pSection, + const char* const pKey) const; - bool ReadUIntValue(uint64_t* value, - uint64_t default_value, - const char* const pSection, - const char* const pKey) const; + /** + * @brief Reads an uint16/32/64_t value from the profile + * + * @param value Result value + * @param default_value Value to use key wasn't found + * @param pSection The section to read the value in + * @param pKey The key whose value needs to be read out + * + * @return FALSE if could not read the value out of the profile + * (then the value is changed to default) + */ + bool ReadUIntValue(uint16_t* value, + uint16_t default_value, + const char* const pSection, + const char* const pKey) const; + + bool ReadUIntValue(uint32_t* value, + uint32_t default_value, + const char* const pSection, + const char* const pKey) const; - /** - * @brief Checks, if path is relative - * @param path Path - * @return true, if is relative, otherwise - false - */ - bool IsRelativePath(const std::string& path); - - /** - * @brief Makes relative path absolute - * @param path Path - */ - void MakeAbsolutePath(std::string& path); - - /** - * @brief Converts input string to number - * @param input Input string - * @param output Output number - * @return true, if successfully converted, otherwise - false - */ - bool StringToNumber(const std::string& input, uint64_t& output) const; - -private: - std::string sdl_version_; - bool launch_hmi_; + bool ReadUIntValue(uint64_t* value, + uint64_t default_value, + const char* const pSection, + const char* const pKey) const; + + /** + * @brief Checks, if path is relative + * @param path Path + * @return true, if is relative, otherwise - false + */ + bool IsRelativePath(const std::string& path); + + /** + * @brief Makes relative path absolute + * @param path Path + */ + void MakeAbsolutePath(std::string& path); + + /** + * @brief Converts input string to number + * @param input Input string + * @param output Output number + * @return true, if successfully converted, otherwise - false + */ + bool StringToNumber(const std::string& input, uint64_t& output) const; + + private: + std::string sdl_version_; + bool launch_hmi_; #ifdef WEB_HMI - std::string link_to_web_hmi_; -#endif // WEB_HMI - std::string app_config_folder_; - std::string app_storage_folder_; - std::string app_resource_folder_; - bool enable_protocol_4_; - std::string app_icons_folder_; - uint32_t app_icons_folder_max_size_; - uint32_t app_icons_amount_to_remove_; - std::string config_file_name_; - std::string server_address_; - uint16_t server_port_; - uint16_t video_streaming_port_; - uint16_t audio_streaming_port_; - uint32_t stop_streaming_timeout_; - uint16_t time_testing_port_; - std::string hmi_capabilities_file_name_; - std::vector<std::string> help_prompt_; - std::vector<std::string> time_out_promt_; - std::vector<std::string> vr_commands_; - uint64_t min_tread_stack_size_; - bool is_mixing_audio_supported_; - bool is_redecoding_enabled_; - uint32_t max_cmd_id_; - uint32_t default_timeout_; - uint32_t app_resuming_timeout_; - uint32_t app_resumption_save_persistent_data_timeout_; - std::string vr_help_title_; - uint32_t app_dir_quota_; - std::string video_consumer_type_; - std::string audio_consumer_type_; - std::string named_video_pipe_path_; - std::string named_audio_pipe_path_; - uint32_t app_hmi_level_none_time_scale_max_requests_; - uint32_t app_hmi_level_none_requests_time_scale_; - std::string video_stream_file_; - std::string audio_stream_file_; - uint32_t app_time_scale_max_requests_; - uint32_t app_requests_time_scale_; - uint32_t pending_requests_amount_; - uint32_t put_file_in_none_; - uint32_t delete_file_in_none_; - uint32_t list_files_in_none_; - uint32_t list_files_response_size_; - std::string app_info_storage_; - uint32_t heart_beat_timeout_; - uint16_t max_supported_protocol_version_; - std::string preloaded_pt_file_; - std::string policy_snapshot_file_name_; - bool enable_policy_; - uint32_t transport_manager_disconnect_timeout_; - bool use_last_state_; - std::vector<uint32_t> supported_diag_modes_; - std::string system_files_path_; - uint16_t transport_manager_tcp_adapter_port_; - std::string tts_delimiter_; - std::uint32_t audio_data_stopped_timeout_; - std::uint32_t video_data_stopped_timeout_; - std::string mme_db_name_; - std::string event_mq_name_; - std::string ack_mq_name_; - std::string recording_file_source_; - std::string recording_file_name_; - uint32_t application_list_update_timeout_; - uint32_t max_thread_pool_size_; - uint32_t default_hub_protocol_index_; + std::string link_to_web_hmi_; +#endif // WEB_HMI + std::string app_config_folder_; + std::string app_storage_folder_; + std::string app_resource_folder_; + bool enable_protocol_4_; + std::string app_icons_folder_; + uint32_t app_icons_folder_max_size_; + uint32_t app_icons_amount_to_remove_; + std::string config_file_name_; + std::string server_address_; + uint16_t server_port_; + uint16_t video_streaming_port_; + uint16_t audio_streaming_port_; + uint32_t stop_streaming_timeout_; + uint16_t time_testing_port_; + std::string hmi_capabilities_file_name_; + std::vector<std::string> help_prompt_; + std::vector<std::string> time_out_promt_; + std::vector<std::string> vr_commands_; + uint64_t min_tread_stack_size_; + bool is_mixing_audio_supported_; + bool is_redecoding_enabled_; + uint32_t max_cmd_id_; + uint32_t default_timeout_; + uint32_t app_resuming_timeout_; + uint32_t app_resumption_save_persistent_data_timeout_; + std::string vr_help_title_; + uint32_t app_dir_quota_; + std::string video_consumer_type_; + std::string audio_consumer_type_; + std::string named_video_pipe_path_; + std::string named_audio_pipe_path_; + uint32_t app_hmi_level_none_time_scale_max_requests_; + uint32_t app_hmi_level_none_requests_time_scale_; + std::string video_stream_file_; + std::string audio_stream_file_; + uint32_t app_time_scale_max_requests_; + uint32_t app_requests_time_scale_; + uint32_t pending_requests_amount_; + uint32_t put_file_in_none_; + uint32_t delete_file_in_none_; + uint32_t list_files_in_none_; + uint32_t list_files_response_size_; + std::string app_info_storage_; + uint32_t heart_beat_timeout_; + uint16_t max_supported_protocol_version_; + std::string preloaded_pt_file_; + std::string policy_snapshot_file_name_; + bool enable_policy_; + uint32_t transport_manager_disconnect_timeout_; + bool use_last_state_; + std::vector<uint32_t> supported_diag_modes_; + std::string system_files_path_; + uint16_t transport_manager_tcp_adapter_port_; + std::string tts_delimiter_; + std::uint32_t audio_data_stopped_timeout_; + std::uint32_t video_data_stopped_timeout_; + std::string mme_db_name_; + std::string event_mq_name_; + std::string ack_mq_name_; + std::string recording_file_source_; + std::string recording_file_name_; + uint32_t application_list_update_timeout_; + uint32_t max_thread_pool_size_; + uint32_t default_hub_protocol_index_; #ifdef ENABLE_SECURITY - std::string cert_path_; - std::string ca_cert_path_; - std::string ssl_mode_; - std::string key_path_; - std::string ciphers_list_; - bool verify_peer_; - uint32_t update_before_hours_; - std::string security_manager_protocol_name_; - std::vector<int> force_protected_service_; - std::vector<int> force_unprotected_service_; + std::string cert_path_; + std::string ca_cert_path_; + std::string ssl_mode_; + std::string key_path_; + std::string ciphers_list_; + bool verify_peer_; + uint32_t update_before_hours_; + std::string security_manager_protocol_name_; + std::vector<int> force_protected_service_; + std::vector<int> force_unprotected_service_; #endif - /* - * first value is count of request - * second is time scale - */ - std::pair<uint32_t, int32_t> read_did_frequency_; - - /* - * first value is count of request - * second is time scale - */ - std::pair<uint32_t, int32_t> get_vehicle_data_frequency_; - - /** - * first value is count of retries for start stream - * second for timer - */ - std::pair<uint32_t, int32_t> start_stream_retry_amount_; - - std::string iap_legacy_protocol_mask_; - std::string iap_hub_protocol_mask_; - std::string iap_pool_protocol_mask_; - std::string iap_system_config_; - std::string iap2_system_config_; - int iap2_hub_connect_attempts_; - int iap_hub_connection_wait_timeout_; - uint16_t tts_global_properties_timeout_; - uint16_t attempts_to_open_policy_db_; - uint16_t open_attempt_timeout_ms_; - uint32_t resumption_delay_before_ign_; - uint32_t resumption_delay_after_ign_; - uint32_t hash_string_size_; - bool logs_enabled_; - bool use_db_for_resumption_; - uint16_t attempts_to_open_resumption_db_; - uint16_t open_attempt_timeout_ms_resumption_db_; + /* + * first value is count of request + * second is time scale + */ + std::pair<uint32_t, int32_t> read_did_frequency_; + + /* + * first value is count of request + * second is time scale + */ + std::pair<uint32_t, int32_t> get_vehicle_data_frequency_; + + /** + * first value is count of retries for start stream + * second for timer + */ + std::pair<uint32_t, int32_t> start_stream_retry_amount_; + + std::string iap_legacy_protocol_mask_; + std::string iap_hub_protocol_mask_; + std::string iap_pool_protocol_mask_; + std::string iap_system_config_; + std::string iap2_system_config_; + int iap2_hub_connect_attempts_; + int iap_hub_connection_wait_timeout_; + uint16_t tts_global_properties_timeout_; + uint16_t attempts_to_open_policy_db_; + uint16_t open_attempt_timeout_ms_; + uint32_t resumption_delay_before_ign_; + uint32_t resumption_delay_after_ign_; + uint32_t hash_string_size_; + bool logs_enabled_; + bool use_db_for_resumption_; + uint16_t attempts_to_open_resumption_db_; + uint16_t open_attempt_timeout_ms_resumption_db_; DISALLOW_COPY_AND_ASSIGN(Profile); }; diff --git a/src/components/config_profile/src/profile.cc b/src/components/config_profile/src/profile.cc index 50f332d80c..4eacbe88ec 100644 --- a/src/components/config_profile/src/profile.cc +++ b/src/components/config_profile/src/profile.cc @@ -47,19 +47,21 @@ #include <openssl/ssl.h> #endif // ENABLE_SECURITY - namespace { -#define LOG_UPDATED_VALUE(value, key, section) {\ - LOG4CXX_INFO(logger_, "Setting value '" << value\ - << "' for key '" << key\ - << "' in section '" << section << "'.");\ -} +#define LOG_UPDATED_VALUE(value, key, section) \ + { \ + LOG4CXX_INFO(logger_, \ + "Setting value '" << value << "' for key '" << key \ + << "' in section '" << section << "'."); \ + } -#define LOG_UPDATED_BOOL_VALUE(value, key, section) {\ - LOG4CXX_INFO(logger_, "Setting value '" << std::boolalpha << value\ - << "' for key '" << key\ - << "' in section '" << section << "'.");\ -} +#define LOG_UPDATED_BOOL_VALUE(value, key, section) \ + { \ + LOG4CXX_INFO(logger_, \ + "Setting value '" << std::boolalpha << value << "' for key '" \ + << key << "' in section '" << section \ + << "'."); \ + } const char* kDefaultConfigFileName = "smartDeviceLink.ini"; @@ -104,7 +106,7 @@ const char* kLaunchHMIKey = "LaunchHMI"; const char* kDefaultSDLVersion = ""; #ifdef WEB_HMI const char* kLinkToWebHMI = "LinkToWebHMI"; -#endif // WEB_HMI +#endif // WEB_HMI const char* kStartStreamRetry = "StartStreamRetry"; const char* kEnableRedecodingKey = "EnableRedecoding"; const char* kVideoStreamConsumerKey = "VideoStreamConsumer"; @@ -187,15 +189,17 @@ const char* kFrequencyTime = "FrequencyTime"; const char* kMalformedMessageFiltering = "MalformedMessageFiltering"; const char* kMalformedFrequencyCount = "MalformedFrequencyCount"; const char* kMalformedFrequencyTime = "MalformedFrequencyTime"; -const char* kExpectedConsecutiveFramesTimeout = "ExpectedConsecutiveFramesTimeout"; +const char* kExpectedConsecutiveFramesTimeout = + "ExpectedConsecutiveFramesTimeout"; const char* kHashStringSizeKey = "HashStringSize"; const char* kUseDBForResumptionKey = "UseDBForResumption"; const char* kAttemptsToOpenResumptionDBKey = "AttemptsToOpenResumptionDB"; -const char* kOpenAttemptTimeoutMsResumptionDBKey = "OpenAttemptTimeoutMsResumptionDB"; +const char* kOpenAttemptTimeoutMsResumptionDBKey = + "OpenAttemptTimeoutMsResumptionDB"; #ifdef WEB_HMI const char* kDefaultLinkToWebHMI = "HMI/index.html"; -#endif // WEB_HMI +#endif // WEB_HMI const char* kDefaultPoliciesSnapshotFileName = "sdl_snapshot.json"; const char* kDefaultHmiCapabilitiesFileName = "hmi_capabilities.json"; const char* kDefaultPreloadedPTFileName = "sdl_preloaded_pt.json"; @@ -221,7 +225,7 @@ const char* kDefaultSecurityProtocol = "TLSv1.2"; const char* kDefaultSSLMode = "CLIENT"; const bool kDefaultVerifyPeer = false; const uint32_t kDefaultBeforeUpdateHours = 24; -#endif // ENABLE_SECURITY +#endif // ENABLE_SECURITY const uint32_t kDefaultHubProtocolIndex = 0; const uint32_t kDefaultHeartBeatTimeout = 0; @@ -252,9 +256,9 @@ const uint32_t kDefaultAppHmiLevelNoneRequestsTimeScale = 10; const uint32_t kDefaultPendingRequestsAmount = 0; const uint32_t kDefaultTransportManagerDisconnectTimeout = 0; const uint32_t kDefaultApplicationListUpdateTimeout = 1; -const std::pair<uint32_t, uint32_t> kReadDIDFrequency = { 5, 1 }; -const std::pair<uint32_t, uint32_t> kGetVehicleDataFrequency = { 5, 1 }; -const std::pair<uint32_t, uint32_t> kStartStreamRetryAmount = { 3, 1 }; +const std::pair<uint32_t, uint32_t> kReadDIDFrequency = {5, 1}; +const std::pair<uint32_t, uint32_t> kGetVehicleDataFrequency = {5, 1}; +const std::pair<uint32_t, uint32_t> kStartStreamRetryAmount = {3, 1}; const uint32_t kDefaultMaxThreadPoolSize = 2; const int kDefaultIAP2HubConnectAttempts = 0; const int kDefaultIAPHubConnectionWaitTimeout = 10000; @@ -281,84 +285,84 @@ namespace profile { CREATE_LOGGERPTR_GLOBAL(logger_, "Profile") Profile::Profile() - : sdl_version_(kDefaultSDLVersion), - launch_hmi_(true), + : sdl_version_(kDefaultSDLVersion) + , launch_hmi_(true) + , #ifdef WEB_HMI - link_to_web_hmi_(kDefaultLinkToWebHMI), -#endif // WEB_HMI - app_config_folder_(), - app_storage_folder_(), - app_resource_folder_(), - enable_protocol_4_(false), - app_icons_folder_(), - app_icons_folder_max_size_(kDefaultAppIconsFolderMaxSize), - app_icons_amount_to_remove_(kDefaultAppIconsAmountToRemove), - config_file_name_(kDefaultConfigFileName), - server_address_(kDefaultServerAddress), - server_port_(kDefaultServerPort), - video_streaming_port_(kDefaultVideoStreamingPort), - audio_streaming_port_(kDefaultAudioStreamingPort), - time_testing_port_(kDefaultTimeTestingPort), - hmi_capabilities_file_name_(kDefaultHmiCapabilitiesFileName), - help_prompt_(), - time_out_promt_(), - min_tread_stack_size_(threads::Thread::kMinStackSize), - is_mixing_audio_supported_(false), - is_redecoding_enabled_(false), - max_cmd_id_(kDefaultMaxCmdId), - default_timeout_(kDefaultTimeout), - app_resuming_timeout_(kDefaultAppResumingTimeout), - app_dir_quota_(kDefaultDirQuota), - app_hmi_level_none_time_scale_max_requests_( - kDefaultAppHmiLevelNoneTimeScaleMaxRequests), - app_hmi_level_none_requests_time_scale_( - kDefaultAppHmiLevelNoneRequestsTimeScale), - app_time_scale_max_requests_(kDefaultAppTimeScaleMaxRequests), - app_requests_time_scale_(kDefaultAppRequestsTimeScale), - pending_requests_amount_(kDefaultPendingRequestsAmount), - put_file_in_none_(kDefaultPutFileRequestInNone), - delete_file_in_none_(kDefaultDeleteFileRequestInNone), - list_files_in_none_(kDefaultListFilesRequestInNone), - list_files_response_size_(kDefaultListFilesResponseSize), - app_info_storage_(kDefaultAppInfoFileName), - heart_beat_timeout_(kDefaultHeartBeatTimeout), - max_supported_protocol_version_(kDefaultMaxSupportedProtocolVersion), - policy_snapshot_file_name_(kDefaultPoliciesSnapshotFileName), - enable_policy_(false), - transport_manager_disconnect_timeout_( - kDefaultTransportManagerDisconnectTimeout), - use_last_state_(false), - supported_diag_modes_(), - system_files_path_(kDefaultSystemFilesPath), - transport_manager_tcp_adapter_port_(kDefautTransportManagerTCPPort), - tts_delimiter_(kDefaultTtsDelimiter), - audio_data_stopped_timeout_(kDefaultAudioDataStoppedTimeout), - video_data_stopped_timeout_(kDefaultVideoDataStoppedTimeout), - event_mq_name_(kDefaultEventMQ), - ack_mq_name_(kDefaultAckMQ), - recording_file_source_(kDefaultRecordingFileSourceName), - recording_file_name_(kDefaultRecordingFileName), - application_list_update_timeout_(kDefaultApplicationListUpdateTimeout), - iap_legacy_protocol_mask_(kDefaultLegacyProtocolMask), - iap_hub_protocol_mask_(kDefaultHubProtocolMask), - iap_pool_protocol_mask_(kDefaultPoolProtocolMask), - iap_system_config_(kDefaultIAPSystemConfig), - iap2_system_config_(kDefaultIAP2SystemConfig), - iap2_hub_connect_attempts_(kDefaultIAP2HubConnectAttempts), - iap_hub_connection_wait_timeout_(kDefaultIAPHubConnectionWaitTimeout), - tts_global_properties_timeout_(kDefaultTTSGlobalPropertiesTimeout), - attempts_to_open_policy_db_(kDefaultAttemptsToOpenPolicyDB), - open_attempt_timeout_ms_(kDefaultAttemptsToOpenPolicyDB), - hash_string_size_(kDefaultHashStringSize), - use_db_for_resumption_(false), - attempts_to_open_resumption_db_(kDefaultAttemptsToOpenResumptionDB), - open_attempt_timeout_ms_resumption_db_(kDefaultOpenAttemptTimeoutMsResumptionDB){ -} - - - -Profile::~Profile() { -} + link_to_web_hmi_(kDefaultLinkToWebHMI) + , +#endif // WEB_HMI + app_config_folder_() + , app_storage_folder_() + , app_resource_folder_() + , enable_protocol_4_(false) + , app_icons_folder_() + , app_icons_folder_max_size_(kDefaultAppIconsFolderMaxSize) + , app_icons_amount_to_remove_(kDefaultAppIconsAmountToRemove) + , config_file_name_(kDefaultConfigFileName) + , server_address_(kDefaultServerAddress) + , server_port_(kDefaultServerPort) + , video_streaming_port_(kDefaultVideoStreamingPort) + , audio_streaming_port_(kDefaultAudioStreamingPort) + , time_testing_port_(kDefaultTimeTestingPort) + , hmi_capabilities_file_name_(kDefaultHmiCapabilitiesFileName) + , help_prompt_() + , time_out_promt_() + , min_tread_stack_size_(threads::Thread::kMinStackSize) + , is_mixing_audio_supported_(false) + , is_redecoding_enabled_(false) + , max_cmd_id_(kDefaultMaxCmdId) + , default_timeout_(kDefaultTimeout) + , app_resuming_timeout_(kDefaultAppResumingTimeout) + , app_dir_quota_(kDefaultDirQuota) + , app_hmi_level_none_time_scale_max_requests_( + kDefaultAppHmiLevelNoneTimeScaleMaxRequests) + , app_hmi_level_none_requests_time_scale_( + kDefaultAppHmiLevelNoneRequestsTimeScale) + , app_time_scale_max_requests_(kDefaultAppTimeScaleMaxRequests) + , app_requests_time_scale_(kDefaultAppRequestsTimeScale) + , pending_requests_amount_(kDefaultPendingRequestsAmount) + , put_file_in_none_(kDefaultPutFileRequestInNone) + , delete_file_in_none_(kDefaultDeleteFileRequestInNone) + , list_files_in_none_(kDefaultListFilesRequestInNone) + , list_files_response_size_(kDefaultListFilesResponseSize) + , app_info_storage_(kDefaultAppInfoFileName) + , heart_beat_timeout_(kDefaultHeartBeatTimeout) + , max_supported_protocol_version_(kDefaultMaxSupportedProtocolVersion) + , policy_snapshot_file_name_(kDefaultPoliciesSnapshotFileName) + , enable_policy_(false) + , transport_manager_disconnect_timeout_( + kDefaultTransportManagerDisconnectTimeout) + , use_last_state_(false) + , supported_diag_modes_() + , system_files_path_(kDefaultSystemFilesPath) + , transport_manager_tcp_adapter_port_(kDefautTransportManagerTCPPort) + , tts_delimiter_(kDefaultTtsDelimiter) + , audio_data_stopped_timeout_(kDefaultAudioDataStoppedTimeout) + , video_data_stopped_timeout_(kDefaultVideoDataStoppedTimeout) + , event_mq_name_(kDefaultEventMQ) + , ack_mq_name_(kDefaultAckMQ) + , recording_file_source_(kDefaultRecordingFileSourceName) + , recording_file_name_(kDefaultRecordingFileName) + , application_list_update_timeout_(kDefaultApplicationListUpdateTimeout) + , iap_legacy_protocol_mask_(kDefaultLegacyProtocolMask) + , iap_hub_protocol_mask_(kDefaultHubProtocolMask) + , iap_pool_protocol_mask_(kDefaultPoolProtocolMask) + , iap_system_config_(kDefaultIAPSystemConfig) + , iap2_system_config_(kDefaultIAP2SystemConfig) + , iap2_hub_connect_attempts_(kDefaultIAP2HubConnectAttempts) + , iap_hub_connection_wait_timeout_(kDefaultIAPHubConnectionWaitTimeout) + , tts_global_properties_timeout_(kDefaultTTSGlobalPropertiesTimeout) + , attempts_to_open_policy_db_(kDefaultAttemptsToOpenPolicyDB) + , open_attempt_timeout_ms_(kDefaultAttemptsToOpenPolicyDB) + , hash_string_size_(kDefaultHashStringSize) + , use_db_for_resumption_(false) + , attempts_to_open_resumption_db_(kDefaultAttemptsToOpenResumptionDB) + , open_attempt_timeout_ms_resumption_db_( + kDefaultOpenAttemptTimeoutMsResumptionDB) { +} + +Profile::~Profile() {} void Profile::config_file_name(const std::string& fileName) { if (false == fileName.empty()) { @@ -383,7 +387,7 @@ bool Profile::launch_hmi() const { std::string Profile::link_to_web_hmi() const { return link_to_web_hmi_; } -#endif // WEB_HMI +#endif // WEB_HMI const std::string& Profile::app_config_folder() const { return app_config_folder_; @@ -401,7 +405,7 @@ bool Profile::enable_protocol_4() const { return enable_protocol_4_; } -const std::string&Profile::app_icons_folder() const { +const std::string& Profile::app_icons_folder() const { return app_icons_folder_; } @@ -409,7 +413,7 @@ const uint32_t& Profile::app_icons_folder_max_size() const { return app_icons_folder_max_size_; } -const uint32_t&Profile::app_icons_amount_to_remove() const { +const uint32_t& Profile::app_icons_amount_to_remove() const { return app_icons_amount_to_remove_; } @@ -565,7 +569,7 @@ uint32_t Profile::heart_beat_timeout() const { return heart_beat_timeout_; } -uint16_t Profile::max_supported_protocol_version() const{ +uint16_t Profile::max_supported_protocol_version() const { return max_supported_protocol_version_; } @@ -628,7 +632,8 @@ const std::pair<uint32_t, int32_t>& Profile::read_did_frequency() const { return read_did_frequency_; } -const std::pair<uint32_t, int32_t>& Profile::get_vehicle_data_frequency() const { +const std::pair<uint32_t, int32_t>& Profile::get_vehicle_data_frequency() + const { return get_vehicle_data_frequency_; } @@ -674,49 +679,63 @@ uint32_t Profile::iap_hub_connection_wait_timeout() const { size_t Profile::maximum_payload_size() const { size_t maximum_payload_size = 0; - ReadUIntValue(&maximum_payload_size, kDefaultMaximumPayloadSize, - kProtocolHandlerSection, kMaximumPayloadSizeKey); + ReadUIntValue(&maximum_payload_size, + kDefaultMaximumPayloadSize, + kProtocolHandlerSection, + kMaximumPayloadSizeKey); return maximum_payload_size; } size_t Profile::message_frequency_count() const { size_t message_frequency_count = 0; - ReadUIntValue(&message_frequency_count, kDefaultFrequencyCount, - kProtocolHandlerSection, kFrequencyCount); + ReadUIntValue(&message_frequency_count, + kDefaultFrequencyCount, + kProtocolHandlerSection, + kFrequencyCount); return message_frequency_count; } size_t Profile::message_frequency_time() const { size_t message_frequency_time = 0; - ReadUIntValue(&message_frequency_time, kDefaultFrequencyTime, - kProtocolHandlerSection, kFrequencyTime); + ReadUIntValue(&message_frequency_time, + kDefaultFrequencyTime, + kProtocolHandlerSection, + kFrequencyTime); return message_frequency_time; } bool Profile::malformed_message_filtering() const { bool malformed_message_filtering = 0; - ReadBoolValue(&malformed_message_filtering, kDefaulMalformedMessageFiltering, - kProtocolHandlerSection, kMalformedMessageFiltering); + ReadBoolValue(&malformed_message_filtering, + kDefaulMalformedMessageFiltering, + kProtocolHandlerSection, + kMalformedMessageFiltering); return malformed_message_filtering; } size_t Profile::malformed_frequency_count() const { size_t malformed_frequency_count = 0; - ReadUIntValue(&malformed_frequency_count, kDefaultMalformedFrequencyCount, - kProtocolHandlerSection, kMalformedFrequencyCount); + ReadUIntValue(&malformed_frequency_count, + kDefaultMalformedFrequencyCount, + kProtocolHandlerSection, + kMalformedFrequencyCount); return malformed_frequency_count; } size_t Profile::malformed_frequency_time() const { size_t malformed_frequency_time = 0; - ReadUIntValue(&malformed_frequency_time, kDefaultMalformedFrequencyTime, - kProtocolHandlerSection, kMalformedFrequencyTime); + ReadUIntValue(&malformed_frequency_time, + kDefaultMalformedFrequencyTime, + kProtocolHandlerSection, + kMalformedFrequencyTime); return malformed_frequency_time; } uint32_t Profile::multiframe_waiting_timeout() const { uint32_t multiframe_waiting_timeout = 0; - ReadUIntValue(&multiframe_waiting_timeout, kDefaultExpectedConsecutiveFramesTimeout, - kProtocolHandlerSection, kExpectedConsecutiveFramesTimeout); + ReadUIntValue(&multiframe_waiting_timeout, + kDefaultExpectedConsecutiveFramesTimeout, + kProtocolHandlerSection, + kExpectedConsecutiveFramesTimeout); return multiframe_waiting_timeout; } @@ -785,7 +804,7 @@ const std::vector<int>& Profile::force_protected_service() const { const std::vector<int>& Profile::force_unprotected_service() const { return force_unprotected_service_; } -#endif // ENABLE_SECURITY +#endif // ENABLE_SECURITY bool Profile::logs_enabled() const { return logs_enabled_; @@ -807,8 +826,8 @@ void Profile::UpdateValues() { LOG4CXX_AUTO_TRACE(logger_); // SDL version - ReadStringValue(&sdl_version_, kDefaultSDLVersion, - kMainSection, kSDLVersionKey); + ReadStringValue( + &sdl_version_, kDefaultSDLVersion, kMainSection, kSDLVersionKey); LOG_UPDATED_VALUE(sdl_version_, kSDLVersionKey, kMainSection); @@ -821,14 +840,14 @@ void Profile::UpdateValues() { launch_hmi_ = false; } - LOG_UPDATED_BOOL_VALUE(launch_hmi_, kLaunchHMIKey, kHmiSection); + LOG_UPDATED_BOOL_VALUE(launch_hmi_, kLaunchHMIKey, kHmiSection); #ifdef WEB_HMI // Link to web HMI parameter - ReadStringValue(&link_to_web_hmi_, kDefaultLinkToWebHMI, - kHmiSection, kLinkToWebHMI); + ReadStringValue( + &link_to_web_hmi_, kDefaultLinkToWebHMI, kHmiSection, kLinkToWebHMI); LOG_UPDATED_BOOL_VALUE(link_to_web_hmi_, kLinkToWebHMI, kHmiSection); -#endif // WEB_HMI +#endif // WEB_HMI #ifdef ENABLE_SECURITY @@ -838,25 +857,33 @@ void Profile::UpdateValues() { force_unprotected_service_ = ReadIntContainer(kSecuritySection, kForceUnprotectedService, NULL); - ReadStringValue(&security_manager_protocol_name_, kDefaultSecurityProtocol, kSecuritySection, - kSecurityProtocolKey); + ReadStringValue(&security_manager_protocol_name_, + kDefaultSecurityProtocol, + kSecuritySection, + kSecurityProtocolKey); - ReadStringValue(&cert_path_, "", kSecuritySection, kSecurityCertificatePathKey); - ReadStringValue(&ca_cert_path_, "", kSecuritySection, kSecurityCACertificatePathKey); + ReadStringValue( + &cert_path_, "", kSecuritySection, kSecurityCertificatePathKey); + ReadStringValue( + &ca_cert_path_, "", kSecuritySection, kSecurityCACertificatePathKey); - ReadStringValue(&ssl_mode_, kDefaultSSLMode, kSecuritySection, - kSecuritySSLModeKey); + ReadStringValue( + &ssl_mode_, kDefaultSSLMode, kSecuritySection, kSecuritySSLModeKey); ReadStringValue(&key_path_, "", kSecuritySection, kSecurityKeyPathKey); - ReadStringValue(&ciphers_list_, SSL_TXT_ALL, kSecuritySection, - kSecurityCipherListKey); + ReadStringValue( + &ciphers_list_, SSL_TXT_ALL, kSecuritySection, kSecurityCipherListKey); - ReadBoolValue(&verify_peer_, kDefaultVerifyPeer, kSecuritySection, - kSecurityVerifyPeerKey); + ReadBoolValue(&verify_peer_, + kDefaultVerifyPeer, + kSecuritySection, + kSecurityVerifyPeerKey); - ReadUIntValue(&update_before_hours_, kDefaultBeforeUpdateHours, - kSecuritySection, kBeforeUpdateHours); + ReadUIntValue(&update_before_hours_, + kDefaultBeforeUpdateHours, + kSecuritySection, + kBeforeUpdateHours); #endif // ENABLE_SECURITY @@ -868,7 +895,8 @@ void Profile::UpdateValues() { // Application config folder ReadStringValue(&app_config_folder_, file_system::CurrentWorkingDirectory().c_str(), - kMainSection, kAppConfigFolderKey); + kMainSection, + kAppConfigFolderKey); if (IsRelativePath(app_config_folder_)) { MakeAbsolutePath(app_config_folder_); @@ -879,7 +907,8 @@ void Profile::UpdateValues() { // Application storage folder ReadStringValue(&app_storage_folder_, file_system::CurrentWorkingDirectory().c_str(), - kMainSection, kAppStorageFolderKey); + kMainSection, + kAppStorageFolderKey); if (IsRelativePath(app_storage_folder_)) { MakeAbsolutePath(app_storage_folder_); @@ -890,14 +919,14 @@ void Profile::UpdateValues() { // Application resourse folder ReadStringValue(&app_resource_folder_, file_system::CurrentWorkingDirectory().c_str(), - kMainSection, kAppResourseFolderKey); + kMainSection, + kAppResourseFolderKey); if (IsRelativePath(app_resource_folder_)) { MakeAbsolutePath(app_resource_folder_); } - LOG_UPDATED_VALUE(app_resource_folder_, kAppResourseFolderKey, - kMainSection); + LOG_UPDATED_VALUE(app_resource_folder_, kAppResourseFolderKey, kMainSection); // Enable protocol ver.4 parameter std::string enable_protocol_4_value; @@ -913,95 +942,108 @@ void Profile::UpdateValues() { // Application icon folder ReadStringValue(&app_icons_folder_, file_system::CurrentWorkingDirectory().c_str(), - kSDL4Section, kAppIconsFolderKey); + kSDL4Section, + kAppIconsFolderKey); if (IsRelativePath(app_icons_folder_)) { MakeAbsolutePath(app_icons_folder_); } - LOG_UPDATED_VALUE(app_icons_folder_, kAppIconsFolderKey, - kSDL4Section); + LOG_UPDATED_VALUE(app_icons_folder_, kAppIconsFolderKey, kSDL4Section); // Application icon folder maximum size - ReadUIntValue(&app_icons_folder_max_size_, kDefaultAppIconsFolderMaxSize, - kSDL4Section, kAppIconsFolderMaxSizeKey); + ReadUIntValue(&app_icons_folder_max_size_, + kDefaultAppIconsFolderMaxSize, + kSDL4Section, + kAppIconsFolderMaxSizeKey); if (app_icons_folder_max_size_ < kDefaultAppIconsFolderMaxSize) { app_icons_folder_max_size_ = kDefaultAppIconsFolderMaxSize; } - LOG_UPDATED_VALUE(app_icons_folder_max_size_, kAppIconsFolderMaxSizeKey, - kSDL4Section); + LOG_UPDATED_VALUE( + app_icons_folder_max_size_, kAppIconsFolderMaxSizeKey, kSDL4Section); // Application icon folder maximum size - ReadUIntValue(&app_icons_amount_to_remove_, kDefaultAppIconsAmountToRemove, - kSDL4Section, kAppIconsAmountToRemoveKey); + ReadUIntValue(&app_icons_amount_to_remove_, + kDefaultAppIconsAmountToRemove, + kSDL4Section, + kAppIconsAmountToRemoveKey); - LOG_UPDATED_VALUE(app_icons_amount_to_remove_, kAppIconsAmountToRemoveKey, - kSDL4Section); + LOG_UPDATED_VALUE( + app_icons_amount_to_remove_, kAppIconsAmountToRemoveKey, kSDL4Section); // Application info file name - ReadStringValue(&app_info_storage_, kDefaultAppInfoFileName, + ReadStringValue(&app_info_storage_, + kDefaultAppInfoFileName, kAppInfoSection, kAppInfoStorageKey); - LOG_UPDATED_VALUE(app_info_storage_, kAppInfoStorageKey, - kAppInfoSection); + LOG_UPDATED_VALUE(app_info_storage_, kAppInfoStorageKey, kAppInfoSection); // Server address - ReadStringValue(&server_address_, kDefaultServerAddress, kHmiSection, - kServerAddressKey); + ReadStringValue( + &server_address_, kDefaultServerAddress, kHmiSection, kServerAddressKey); LOG_UPDATED_VALUE(server_address_, kServerAddressKey, kHmiSection); // HMI capabilities - ReadStringValue(&hmi_capabilities_file_name_ , + ReadStringValue(&hmi_capabilities_file_name_, kDefaultHmiCapabilitiesFileName, - kMainSection, kHmiCapabilitiesKey); + kMainSection, + kHmiCapabilitiesKey); - hmi_capabilities_file_name_ = app_config_folder_ + "/" + - hmi_capabilities_file_name_; + hmi_capabilities_file_name_ = + app_config_folder_ + "/" + hmi_capabilities_file_name_; - LOG_UPDATED_VALUE(hmi_capabilities_file_name_, kHmiCapabilitiesKey, - kMainSection); + LOG_UPDATED_VALUE( + hmi_capabilities_file_name_, kHmiCapabilitiesKey, kMainSection); // Server port - ReadUIntValue(&server_port_, kDefaultServerPort, kHmiSection, - kServerPortKey); + ReadUIntValue(&server_port_, kDefaultServerPort, kHmiSection, kServerPortKey); LOG_UPDATED_VALUE(server_port_, kServerPortKey, kHmiSection); // Video streaming port - ReadUIntValue(&video_streaming_port_, kDefaultVideoStreamingPort, - kHmiSection, kVideoStreamingPortKey); + ReadUIntValue(&video_streaming_port_, + kDefaultVideoStreamingPort, + kHmiSection, + kVideoStreamingPortKey); - LOG_UPDATED_VALUE(video_streaming_port_, kVideoStreamingPortKey, - kHmiSection); + LOG_UPDATED_VALUE(video_streaming_port_, kVideoStreamingPortKey, kHmiSection); // Audio streaming port - ReadUIntValue(&audio_streaming_port_, kDefaultAudioStreamingPort, - kHmiSection, kAudioStreamingPortKey); + ReadUIntValue(&audio_streaming_port_, + kDefaultAudioStreamingPort, + kHmiSection, + kAudioStreamingPortKey); - LOG_UPDATED_VALUE(audio_streaming_port_, kAudioStreamingPortKey, - kHmiSection); + LOG_UPDATED_VALUE(audio_streaming_port_, kAudioStreamingPortKey, kHmiSection); // Streaming timeout - ReadUIntValue(&stop_streaming_timeout_, kDefaultStopStreamingTimeout, - kMediaManagerSection, kStopStreamingTimeout); + ReadUIntValue(&stop_streaming_timeout_, + kDefaultStopStreamingTimeout, + kMediaManagerSection, + kStopStreamingTimeout); - stop_streaming_timeout_ = std::max(kDefaultStopStreamingTimeout, stop_streaming_timeout_); + stop_streaming_timeout_ = + std::max(kDefaultStopStreamingTimeout, stop_streaming_timeout_); - LOG_UPDATED_VALUE(stop_streaming_timeout_, kStopStreamingTimeout, - kHmiSection); + LOG_UPDATED_VALUE( + stop_streaming_timeout_, kStopStreamingTimeout, kHmiSection); // Time testing port - ReadUIntValue(&time_testing_port_, kDefaultTimeTestingPort, kMainSection, + ReadUIntValue(&time_testing_port_, + kDefaultTimeTestingPort, + kMainSection, kTimeTestingPortKey); LOG_UPDATED_VALUE(time_testing_port_, kTimeTestingPortKey, kMainSection); // Minimum thread stack size - ReadUIntValue(&min_tread_stack_size_, threads::Thread::kMinStackSize, - kMainSection, kThreadStackSizeKey); + ReadUIntValue(&min_tread_stack_size_, + threads::Thread::kMinStackSize, + kMainSection, + kThreadStackSizeKey); if (min_tread_stack_size_ < threads::Thread::kMinStackSize) { min_tread_stack_size_ = threads::Thread::kMinStackSize; @@ -1010,94 +1052,107 @@ void Profile::UpdateValues() { LOG_UPDATED_VALUE(min_tread_stack_size_, kThreadStackSizeKey, kMainSection); // Start stream retry frequency - ReadUintIntPairValue(&start_stream_retry_amount_, kStartStreamRetryAmount, - kMediaManagerSection, kStartStreamRetry); + ReadUintIntPairValue(&start_stream_retry_amount_, + kStartStreamRetryAmount, + kMediaManagerSection, + kStartStreamRetry); // Redecoding parameter std::string redecoding_value; - if (ReadValue(&redecoding_value, kMediaManagerSection, kEnableRedecodingKey) - && 0 == strcmp("true", redecoding_value.c_str())) { + if (ReadValue( + &redecoding_value, kMediaManagerSection, kEnableRedecodingKey) && + 0 == strcmp("true", redecoding_value.c_str())) { is_redecoding_enabled_ = true; } else { is_redecoding_enabled_ = false; } - LOG_UPDATED_BOOL_VALUE(is_redecoding_enabled_, kEnableRedecodingKey, - kMediaManagerSection); + LOG_UPDATED_BOOL_VALUE( + is_redecoding_enabled_, kEnableRedecodingKey, kMediaManagerSection); // Video consumer type - ReadStringValue(&video_consumer_type_, "", kMediaManagerSection, - kVideoStreamConsumerKey); + ReadStringValue( + &video_consumer_type_, "", kMediaManagerSection, kVideoStreamConsumerKey); - LOG_UPDATED_VALUE(video_consumer_type_, kVideoStreamConsumerKey, - kMediaManagerSection); + LOG_UPDATED_VALUE( + video_consumer_type_, kVideoStreamConsumerKey, kMediaManagerSection); // Audio stream consumer - ReadStringValue(&audio_consumer_type_, "", kMediaManagerSection, - kAudioStreamConsumerKey); + ReadStringValue( + &audio_consumer_type_, "", kMediaManagerSection, kAudioStreamConsumerKey); - LOG_UPDATED_VALUE(audio_consumer_type_, kAudioStreamConsumerKey, - kMediaManagerSection); + LOG_UPDATED_VALUE( + audio_consumer_type_, kAudioStreamConsumerKey, kMediaManagerSection); // Named video pipe path - ReadStringValue(&named_video_pipe_path_, "", kMediaManagerSection, + ReadStringValue(&named_video_pipe_path_, + "", + kMediaManagerSection, kNamedVideoPipePathKey); named_video_pipe_path_ = app_storage_folder_ + "/" + named_video_pipe_path_; - LOG_UPDATED_VALUE(named_video_pipe_path_, kNamedVideoPipePathKey, - kMediaManagerSection); + LOG_UPDATED_VALUE( + named_video_pipe_path_, kNamedVideoPipePathKey, kMediaManagerSection); // Named audio pipe path - ReadStringValue(&named_audio_pipe_path_, "", kMediaManagerSection, + ReadStringValue(&named_audio_pipe_path_, + "", + kMediaManagerSection, kNamedAudioPipePathKey); named_audio_pipe_path_ = app_storage_folder_ + "/" + named_audio_pipe_path_; - LOG_UPDATED_VALUE(named_audio_pipe_path_, kNamedAudioPipePathKey, - kMediaManagerSection); + LOG_UPDATED_VALUE( + named_audio_pipe_path_, kNamedAudioPipePathKey, kMediaManagerSection); // Video stream file - ReadStringValue(&video_stream_file_, "", kMediaManagerSection, - kVideoStreamFileKey); + ReadStringValue( + &video_stream_file_, "", kMediaManagerSection, kVideoStreamFileKey); video_stream_file_ = app_storage_folder_ + "/" + video_stream_file_; - LOG_UPDATED_VALUE(video_stream_file_, kVideoStreamFileKey, - kMediaManagerSection); + LOG_UPDATED_VALUE( + video_stream_file_, kVideoStreamFileKey, kMediaManagerSection); // Audio stream file - ReadStringValue(&audio_stream_file_, "", kMediaManagerSection, - kAudioStreamFileKey); + ReadStringValue( + &audio_stream_file_, "", kMediaManagerSection, kAudioStreamFileKey); audio_stream_file_ = app_storage_folder_ + "/" + audio_stream_file_; - LOG_UPDATED_VALUE(audio_stream_file_, kAudioStreamFileKey, - kMediaManagerSection); + LOG_UPDATED_VALUE( + audio_stream_file_, kAudioStreamFileKey, kMediaManagerSection); - ReadUIntValue(&audio_data_stopped_timeout_, kDefaultAudioDataStoppedTimeout, - kMediaManagerSection, kAudioDataStoppedTimeoutKey); + ReadUIntValue(&audio_data_stopped_timeout_, + kDefaultAudioDataStoppedTimeout, + kMediaManagerSection, + kAudioDataStoppedTimeoutKey); - LOG_UPDATED_VALUE(audio_data_stopped_timeout_, kAudioDataStoppedTimeoutKey, + LOG_UPDATED_VALUE(audio_data_stopped_timeout_, + kAudioDataStoppedTimeoutKey, kMediaManagerSection); - ReadUIntValue(&video_data_stopped_timeout_, kDefaultVideoDataStoppedTimeout, - kMediaManagerSection, kVideoDataStoppedTimeoutKey); + ReadUIntValue(&video_data_stopped_timeout_, + kDefaultVideoDataStoppedTimeout, + kMediaManagerSection, + kVideoDataStoppedTimeoutKey); - LOG_UPDATED_VALUE(video_data_stopped_timeout_, kVideoDataStoppedTimeoutKey, + LOG_UPDATED_VALUE(video_data_stopped_timeout_, + kVideoDataStoppedTimeoutKey, kMediaManagerSection); // Mixing audio parameter std::string mixing_audio_value; - if (ReadValue(&mixing_audio_value, kMainSection, kMixingAudioSupportedKey) - && 0 == strcmp("true", mixing_audio_value.c_str())) { + if (ReadValue(&mixing_audio_value, kMainSection, kMixingAudioSupportedKey) && + 0 == strcmp("true", mixing_audio_value.c_str())) { is_mixing_audio_supported_ = true; } else { is_mixing_audio_supported_ = false; } - LOG_UPDATED_BOOL_VALUE(is_mixing_audio_supported_, kMixingAudioSupportedKey, - kMainSection); + LOG_UPDATED_BOOL_VALUE( + is_mixing_audio_supported_, kMixingAudioSupportedKey, kMainSection); // Maximum command id value ReadUIntValue(&max_cmd_id_, kDefaultMaxCmdId, kMainSection, kMaxCmdIdKey); @@ -1105,36 +1160,47 @@ void Profile::UpdateValues() { LOG_UPDATED_VALUE(max_cmd_id_, kMaxCmdIdKey, kMainSection); // PutFile restrictions - ReadUIntValue(&put_file_in_none_, kDefaultPutFileRequestInNone, - kFilesystemRestrictionsSection, kPutFileRequestKey); + ReadUIntValue(&put_file_in_none_, + kDefaultPutFileRequestInNone, + kFilesystemRestrictionsSection, + kPutFileRequestKey); - LOG_UPDATED_VALUE(put_file_in_none_, kPutFileRequestKey, - kFilesystemRestrictionsSection); + LOG_UPDATED_VALUE( + put_file_in_none_, kPutFileRequestKey, kFilesystemRestrictionsSection); // DeleteFileRestrictions - ReadUIntValue(&delete_file_in_none_, kDefaultDeleteFileRequestInNone, - kFilesystemRestrictionsSection, kDeleteFileRequestKey); + ReadUIntValue(&delete_file_in_none_, + kDefaultDeleteFileRequestInNone, + kFilesystemRestrictionsSection, + kDeleteFileRequestKey); - LOG_UPDATED_VALUE(delete_file_in_none_, kDeleteFileRequestKey, + LOG_UPDATED_VALUE(delete_file_in_none_, + kDeleteFileRequestKey, kFilesystemRestrictionsSection); // ListFiles restrictions - ReadUIntValue(&list_files_in_none_, kDefaultListFilesRequestInNone, - kFilesystemRestrictionsSection, kListFilesRequestKey); + ReadUIntValue(&list_files_in_none_, + kDefaultListFilesRequestInNone, + kFilesystemRestrictionsSection, + kListFilesRequestKey); - LOG_UPDATED_VALUE(list_files_in_none_, kListFilesRequestKey, + LOG_UPDATED_VALUE(list_files_in_none_, + kListFilesRequestKey, kFilesystemRestrictionsSection); // ListFiles request size - ReadUIntValue(&list_files_response_size_, kDefaultListFilesResponseSize, - kFilesystemRestrictionsSection, kListFilesResponseSizeKey); + ReadUIntValue(&list_files_response_size_, + kDefaultListFilesResponseSize, + kFilesystemRestrictionsSection, + kListFilesResponseSizeKey); - LOG_UPDATED_VALUE(list_files_response_size_, kListFilesResponseSizeKey, + LOG_UPDATED_VALUE(list_files_response_size_, + kListFilesResponseSizeKey, kFilesystemRestrictionsSection); // Default timeout - ReadUIntValue(&default_timeout_, kDefaultTimeout, kMainSection, - kDefaultTimeoutKey); + ReadUIntValue( + &default_timeout_, kDefaultTimeout, kMainSection, kDefaultTimeoutKey); if (default_timeout_ == 0) { default_timeout_ = kDefaultTimeout; @@ -1143,25 +1209,29 @@ void Profile::UpdateValues() { LOG_UPDATED_VALUE(default_timeout_, kDefaultTimeoutKey, kMainSection); // Application resuming timeout - ReadUIntValue(&app_resuming_timeout_, kDefaultAppResumingTimeout, - kResumptionSection, kAppResumingTimeoutKey); + ReadUIntValue(&app_resuming_timeout_, + kDefaultAppResumingTimeout, + kResumptionSection, + kAppResumingTimeoutKey); if (app_resuming_timeout_ == 0) { app_resuming_timeout_ = kDefaultAppResumingTimeout; } // Save resumption info to File System - LOG_UPDATED_VALUE(app_resuming_timeout_, kAppSavePersistentDataTimeoutKey, + LOG_UPDATED_VALUE(app_resuming_timeout_, + kAppSavePersistentDataTimeoutKey, kResumptionSection); ReadUIntValue(&app_resumption_save_persistent_data_timeout_, kDefaultAppSavePersistentDataTimeout, - kResumptionSection, kAppSavePersistentDataTimeoutKey); + kResumptionSection, + kAppSavePersistentDataTimeoutKey); if (app_resuming_timeout_ == 0) { app_resuming_timeout_ = kDefaultAppSavePersistentDataTimeout; } - LOG_UPDATED_VALUE(app_resuming_timeout_, kAppResumingTimeoutKey, - kResumptionSection); + LOG_UPDATED_VALUE( + app_resuming_timeout_, kAppResumingTimeoutKey, kResumptionSection); // Open attempt timeout in ms ReadUIntValue(&resumption_delay_before_ign_, kDefaultResumptionDelayBeforeIgn, @@ -1169,7 +1239,8 @@ void Profile::UpdateValues() { kResumptionDelayBeforeIgnKey); LOG_UPDATED_VALUE(resumption_delay_before_ign_, - kResumptionDelayBeforeIgnKey, kResumptionSection); + kResumptionDelayBeforeIgnKey, + kResumptionSection); // Open attempt timeout in ms ReadUIntValue(&resumption_delay_after_ign_, @@ -1178,11 +1249,12 @@ void Profile::UpdateValues() { kResumptionDelayAfterIgnKey); LOG_UPDATED_VALUE(resumption_delay_after_ign_, - kResumptionDelayAfterIgnKey, kResumptionSection); + kResumptionDelayAfterIgnKey, + kResumptionSection); // Application directory quota - ReadUIntValue(&app_dir_quota_, kDefaultDirQuota, kMainSection, - kAppDirectoryQuotaKey); + ReadUIntValue( + &app_dir_quota_, kDefaultDirQuota, kMainSection, kAppDirectoryQuotaKey); if (app_dir_quota_ == 0) { app_dir_quota_ = kDefaultDirQuota; @@ -1192,68 +1264,62 @@ void Profile::UpdateValues() { // TTS delimiter // Should be gotten before any TTS prompts, since it should be appended back - ReadStringValue(&tts_delimiter_, kDefaultTtsDelimiter, - kGlobalPropertiesSection, kTTSDelimiterKey); + ReadStringValue(&tts_delimiter_, + kDefaultTtsDelimiter, + kGlobalPropertiesSection, + kTTSDelimiterKey); - LOG_UPDATED_VALUE(tts_delimiter_, kTTSDelimiterKey, - kGlobalPropertiesSection); + LOG_UPDATED_VALUE(tts_delimiter_, kTTSDelimiterKey, kGlobalPropertiesSection); // Help prompt help_prompt_.clear(); std::string help_prompt_value; - if (ReadValue(&help_prompt_value, kGlobalPropertiesSection, - kHelpPromptKey)) { + if (ReadValue(&help_prompt_value, kGlobalPropertiesSection, kHelpPromptKey)) { char* str = NULL; str = strtok(const_cast<char*>(help_prompt_value.c_str()), ","); while (str != NULL) { // Default prompt should have delimiter included for each item const std::string prompt_item = std::string(str) + tts_delimiter_; help_prompt_.push_back(prompt_item); - LOG_UPDATED_VALUE(prompt_item, kHelpPromptKey, - kGlobalPropertiesSection); + LOG_UPDATED_VALUE(prompt_item, kHelpPromptKey, kGlobalPropertiesSection); str = strtok(NULL, ","); } } else { help_prompt_value.clear(); - LOG_UPDATED_VALUE(help_prompt_value, kHelpPromptKey, - kGlobalPropertiesSection); + LOG_UPDATED_VALUE( + help_prompt_value, kHelpPromptKey, kGlobalPropertiesSection); } - - // Timeout prompt time_out_promt_.clear(); std::string timeout_prompt_value; - if (ReadValue(&timeout_prompt_value, kGlobalPropertiesSection, - kTimeoutPromptKey)) { + if (ReadValue( + &timeout_prompt_value, kGlobalPropertiesSection, kTimeoutPromptKey)) { char* str = NULL; str = strtok(const_cast<char*>(timeout_prompt_value.c_str()), ","); while (str != NULL) { // Default prompt should have delimiter included for each item const std::string prompt_item = std::string(str) + tts_delimiter_; time_out_promt_.push_back(prompt_item); - LOG_UPDATED_VALUE(prompt_item, kTimeoutPromptKey, - kGlobalPropertiesSection); + LOG_UPDATED_VALUE( + prompt_item, kTimeoutPromptKey, kGlobalPropertiesSection); str = strtok(NULL, ","); } } else { timeout_prompt_value.clear(); - LOG_UPDATED_VALUE(timeout_prompt_value, kTimeoutPromptKey, - kGlobalPropertiesSection); + LOG_UPDATED_VALUE( + timeout_prompt_value, kTimeoutPromptKey, kGlobalPropertiesSection); } // Voice recognition help title - ReadStringValue(&vr_help_title_, "", kGlobalPropertiesSection, - kHelpTitleKey); + ReadStringValue(&vr_help_title_, "", kGlobalPropertiesSection, kHelpTitleKey); - LOG_UPDATED_VALUE(vr_help_title_, kHelpTitleKey, - kGlobalPropertiesSection); + LOG_UPDATED_VALUE(vr_help_title_, kHelpTitleKey, kGlobalPropertiesSection); // Voice recognition help command vr_commands_.clear(); std::string vr_help_command_value; - if (ReadValue(&vr_help_command_value, kVrCommandsSection, - kHelpCommandKey)) { + if (ReadValue(&vr_help_command_value, kVrCommandsSection, kHelpCommandKey)) { char* str = NULL; str = strtok(const_cast<char*>(vr_help_command_value.c_str()), ","); while (str != NULL) { @@ -1264,17 +1330,18 @@ void Profile::UpdateValues() { } } else { vr_help_command_value.clear(); - LOG_UPDATED_VALUE(vr_help_command_value, kHelpCommandKey, - kVrCommandsSection); + LOG_UPDATED_VALUE( + vr_help_command_value, kHelpCommandKey, kVrCommandsSection); } - //TTS GlobalProperties timeout + // TTS GlobalProperties timeout ReadUIntValue(&tts_global_properties_timeout_, kDefaultTTSGlobalPropertiesTimeout, kGlobalPropertiesSection, kTTSGlobalPropertiesTimeoutKey); - LOG_UPDATED_VALUE(tts_global_properties_timeout_, kTTSGlobalPropertiesTimeoutKey, + LOG_UPDATED_VALUE(tts_global_properties_timeout_, + kTTSGlobalPropertiesTimeoutKey, kGlobalPropertiesSection); // Application time scale maximum requests @@ -1283,15 +1350,17 @@ void Profile::UpdateValues() { kMainSection, kAppTimeScaleMaxRequestsKey); - LOG_UPDATED_VALUE(app_time_scale_max_requests_, kAppTimeScaleMaxRequestsKey, - kMainSection); + LOG_UPDATED_VALUE( + app_time_scale_max_requests_, kAppTimeScaleMaxRequestsKey, kMainSection); // Application time scale - ReadUIntValue(&app_requests_time_scale_, kDefaultAppRequestsTimeScale, - kMainSection, kAppRequestsTimeScaleKey); + ReadUIntValue(&app_requests_time_scale_, + kDefaultAppRequestsTimeScale, + kMainSection, + kAppRequestsTimeScaleKey); - LOG_UPDATED_VALUE(app_requests_time_scale_, kAppRequestsTimeScaleKey, - kMainSection); + LOG_UPDATED_VALUE( + app_requests_time_scale_, kAppRequestsTimeScaleKey, kMainSection); // Application HMI level NONE time scale maximum requests ReadUIntValue(&app_hmi_level_none_time_scale_max_requests_, @@ -1314,21 +1383,25 @@ void Profile::UpdateValues() { kMainSection); // Amount of pending requests - ReadUIntValue(&pending_requests_amount_, kDefaultPendingRequestsAmount, - kMainSection, kPendingRequestsAmoundKey); + ReadUIntValue(&pending_requests_amount_, + kDefaultPendingRequestsAmount, + kMainSection, + kPendingRequestsAmoundKey); if (pending_requests_amount_ == 0) { pending_requests_amount_ = kDefaultPendingRequestsAmount; } - LOG_UPDATED_VALUE(pending_requests_amount_, kPendingRequestsAmoundKey, - kMainSection); + LOG_UPDATED_VALUE( + pending_requests_amount_, kPendingRequestsAmoundKey, kMainSection); // Supported diagnostic modes supported_diag_modes_.clear(); std::string supported_diag_modes_value; std::string correct_diag_modes; - if (ReadStringValue(&supported_diag_modes_value, "", kMainSection, + if (ReadStringValue(&supported_diag_modes_value, + "", + kMainSection, kSupportedDiagModesKey)) { char* str = NULL; str = strtok(const_cast<char*>(supported_diag_modes_value.c_str()), ","); @@ -1347,13 +1420,17 @@ void Profile::UpdateValues() { LOG_UPDATED_VALUE(correct_diag_modes, kSupportedDiagModesKey, kMainSection); // System files path - ReadStringValue(&system_files_path_, kDefaultSystemFilesPath, kMainSection, + ReadStringValue(&system_files_path_, + kDefaultSystemFilesPath, + kMainSection, kSystemFilesPathKey); LOG_UPDATED_VALUE(system_files_path_, kSystemFilesPathKey, kMainSection); // Heartbeat timeout - ReadUIntValue(&heart_beat_timeout_, kDefaultHeartBeatTimeout, kMainSection, + ReadUIntValue(&heart_beat_timeout_, + kDefaultHeartBeatTimeout, + kMainSection, kHeartBeatTimeoutKey); LOG_UPDATED_VALUE(heart_beat_timeout_, kHeartBeatTimeoutKey, kMainSection); @@ -1375,22 +1452,19 @@ void Profile::UpdateValues() { kTransportManagerSection, kTCPAdapterPortKey); - LOG_UPDATED_VALUE(transport_manager_tcp_adapter_port_, kTCPAdapterPortKey, + LOG_UPDATED_VALUE(transport_manager_tcp_adapter_port_, + kTCPAdapterPortKey, kTransportManagerSection); // Event MQ - ReadStringValue(&event_mq_name_, - kDefaultEventMQ, - kTransportManagerSection, - kEventMQKey); + ReadStringValue( + &event_mq_name_, kDefaultEventMQ, kTransportManagerSection, kEventMQKey); LOG_UPDATED_VALUE(event_mq_name_, kEventMQKey, kTransportManagerSection); // Ack MQ - ReadStringValue(&ack_mq_name_, - kDefaultAckMQ, - kTransportManagerSection, - kAckMQKey); + ReadStringValue( + &ack_mq_name_, kDefaultAckMQ, kTransportManagerSection, kAckMQKey); LOG_UPDATED_VALUE(ack_mq_name_, kAckMQKey, kTransportManagerSection); @@ -1405,22 +1479,28 @@ void Profile::UpdateValues() { kTransportManagerSection); // Recording file - ReadStringValue(&recording_file_name_, kDefaultRecordingFileName, - kMediaManagerSection, kRecordingFileNameKey); + ReadStringValue(&recording_file_name_, + kDefaultRecordingFileName, + kMediaManagerSection, + kRecordingFileNameKey); - LOG_UPDATED_VALUE(recording_file_name_, kRecordingFileNameKey, kMediaManagerSection); + LOG_UPDATED_VALUE( + recording_file_name_, kRecordingFileNameKey, kMediaManagerSection); // Recording file source - ReadStringValue(&recording_file_source_, kDefaultRecordingFileSourceName, - kMediaManagerSection, kRecordingFileSourceKey); + ReadStringValue(&recording_file_source_, + kDefaultRecordingFileSourceName, + kMediaManagerSection, + kRecordingFileSourceKey); - LOG_UPDATED_VALUE(recording_file_source_, kRecordingFileSourceKey, - kMediaManagerSection); + LOG_UPDATED_VALUE( + recording_file_source_, kRecordingFileSourceKey, kMediaManagerSection); // Policy preloaded file ReadStringValue(&preloaded_pt_file_, kDefaultPreloadedPTFileName, - kPolicySection, kPreloadedPTKey); + kPolicySection, + kPreloadedPTKey); preloaded_pt_file_ = app_config_folder_ + '/' + preloaded_pt_file_; @@ -1429,10 +1509,11 @@ void Profile::UpdateValues() { // Policy snapshot file ReadStringValue(&policy_snapshot_file_name_, kDefaultPoliciesSnapshotFileName, - kPolicySection, kPathToSnapshotKey); + kPolicySection, + kPathToSnapshotKey); - LOG_UPDATED_VALUE(policy_snapshot_file_name_, kPathToSnapshotKey, - kPolicySection); + LOG_UPDATED_VALUE( + policy_snapshot_file_name_, kPathToSnapshotKey, kPolicySection); // Attempts number for opening policy DB ReadUIntValue(&attempts_to_open_policy_db_, @@ -1440,15 +1521,17 @@ void Profile::UpdateValues() { kPolicySection, kAttemptsToOpenPolicyDBKey); - LOG_UPDATED_VALUE(attempts_to_open_policy_db_, - kAttemptsToOpenPolicyDBKey, kPolicySection); + LOG_UPDATED_VALUE( + attempts_to_open_policy_db_, kAttemptsToOpenPolicyDBKey, kPolicySection); // Open attempt timeout in ms - ReadUIntValue(&open_attempt_timeout_ms_, kDefaultOpenAttemptTimeoutMs, - kPolicySection, kOpenAttemptTimeoutMsKey); + ReadUIntValue(&open_attempt_timeout_ms_, + kDefaultOpenAttemptTimeoutMs, + kPolicySection, + kOpenAttemptTimeoutMsKey); - LOG_UPDATED_VALUE(open_attempt_timeout_ms_, - kOpenAttemptTimeoutMsKey, kPolicySection); + LOG_UPDATED_VALUE( + open_attempt_timeout_ms_, kOpenAttemptTimeoutMsKey, kPolicySection); // Turn Policy Off? std::string enable_policy_string; @@ -1479,13 +1562,18 @@ void Profile::UpdateValues() { kApplicationListUpdateTimeoutKey); LOG_UPDATED_VALUE(application_list_update_timeout_, - kApplicationListUpdateTimeoutKey, kMainSection); + kApplicationListUpdateTimeoutKey, + kMainSection); - ReadUintIntPairValue(&read_did_frequency_, kReadDIDFrequency, - kMainSection, kReadDIDFrequencykey); + ReadUintIntPairValue(&read_did_frequency_, + kReadDIDFrequency, + kMainSection, + kReadDIDFrequencykey); - ReadUintIntPairValue(&get_vehicle_data_frequency_, kGetVehicleDataFrequency, - kMainSection, kGetVehicleDataFrequencyKey); + ReadUintIntPairValue(&get_vehicle_data_frequency_, + kGetVehicleDataFrequency, + kMainSection, + kGetVehicleDataFrequencyKey); ReadUIntValue(&max_thread_pool_size_, kDefaultMaxThreadPoolSize, @@ -1495,14 +1583,16 @@ void Profile::UpdateValues() { max_thread_pool_size_ = kDefaultMaxThreadPoolSize; } LOG_UPDATED_VALUE(max_thread_pool_size_, - kDefaultMaxThreadPoolSize, kApplicationManagerSection); + kDefaultMaxThreadPoolSize, + kApplicationManagerSection); ReadStringValue(&iap_legacy_protocol_mask_, kDefaultLegacyProtocolMask, kIAPSection, kLegacyProtocolMaskKey); - LOG_UPDATED_VALUE(iap_legacy_protocol_mask_, kLegacyProtocolMaskKey, kIAPSection); + LOG_UPDATED_VALUE( + iap_legacy_protocol_mask_, kLegacyProtocolMaskKey, kIAPSection); ReadStringValue(&iap_hub_protocol_mask_, kDefaultHubProtocolMask, @@ -1537,7 +1627,8 @@ void Profile::UpdateValues() { kIAPSection, kIAP2HubConnectAttemptskey); - LOG_UPDATED_VALUE(iap2_hub_connect_attempts_, kIAP2HubConnectAttemptskey, kIAPSection); + LOG_UPDATED_VALUE( + iap2_hub_connect_attempts_, kIAP2HubConnectAttemptskey, kIAPSection); ReadIntValue(&iap_hub_connection_wait_timeout_, kDefaultIAPHubConnectionWaitTimeout, @@ -1545,51 +1636,62 @@ void Profile::UpdateValues() { kIAPHubConnectionWaitTimeoutKey); LOG_UPDATED_VALUE(iap_hub_connection_wait_timeout_, - kIAPHubConnectionWaitTimeoutKey, kIAPSection); + kIAPHubConnectionWaitTimeoutKey, + kIAPSection); - ReadUIntValue(&default_hub_protocol_index_, kDefaultHubProtocolIndex, kIAPSection, kDefaultHubProtocolIndexKey); + ReadUIntValue(&default_hub_protocol_index_, + kDefaultHubProtocolIndex, + kIAPSection, + kDefaultHubProtocolIndexKey); - LOG_UPDATED_VALUE(default_hub_protocol_index_, kDefaultHubProtocolIndexKey, kIAPSection); + LOG_UPDATED_VALUE( + default_hub_protocol_index_, kDefaultHubProtocolIndexKey, kIAPSection); - ReadUIntValue(&hash_string_size_, + ReadUIntValue(&hash_string_size_, kDefaultHashStringSize, kApplicationManagerSection, kHashStringSizeKey); - LOG_UPDATED_VALUE(hash_string_size_, - kHashStringSizeKey, - kApplicationManagerSection); + LOG_UPDATED_VALUE( + hash_string_size_, kHashStringSizeKey, kApplicationManagerSection); - ReadBoolValue(&use_db_for_resumption_, false, kResumptionSection, + ReadBoolValue(&use_db_for_resumption_, + false, + kResumptionSection, kUseDBForResumptionKey); - LOG_UPDATED_BOOL_VALUE(use_db_for_resumption_, kUseDBForResumptionKey, - kResumptionSection); + LOG_UPDATED_BOOL_VALUE( + use_db_for_resumption_, kUseDBForResumptionKey, kResumptionSection); - ReadUIntValue(&attempts_to_open_resumption_db_, kDefaultAttemptsToOpenResumptionDB, - kResumptionSection, kAttemptsToOpenResumptionDBKey); + ReadUIntValue(&attempts_to_open_resumption_db_, + kDefaultAttemptsToOpenResumptionDB, + kResumptionSection, + kAttemptsToOpenResumptionDBKey); - LOG_UPDATED_VALUE(attempts_to_open_resumption_db_, kAttemptsToOpenResumptionDBKey, + LOG_UPDATED_VALUE(attempts_to_open_resumption_db_, + kAttemptsToOpenResumptionDBKey, kResumptionSection); ReadUIntValue(&open_attempt_timeout_ms_resumption_db_, kDefaultOpenAttemptTimeoutMsResumptionDB, - kResumptionSection, kOpenAttemptTimeoutMsResumptionDBKey); + kResumptionSection, + kOpenAttemptTimeoutMsResumptionDBKey); LOG_UPDATED_VALUE(open_attempt_timeout_ms_resumption_db_, kOpenAttemptTimeoutMsResumptionDBKey, kResumptionSection); } -bool Profile::ReadValue(bool* value, const char* const pSection, +bool Profile::ReadValue(bool* value, + const char* const pSection, const char* const pKey) const { DCHECK(value); bool ret = false; char buf[INI_LINE_LEN + 1]; *buf = '\0'; - if ((0 != ini_read_value(config_file_name_.c_str(), pSection, pKey, buf)) - && ('\0' != *buf)) { + if ((0 != ini_read_value(config_file_name_.c_str(), pSection, pKey, buf)) && + ('\0' != *buf)) { const int32_t tmpVal = atoi(buf); if ((0 == strcmp("true", buf)) || (0 != tmpVal)) { *value = true; @@ -1601,22 +1703,24 @@ bool Profile::ReadValue(bool* value, const char* const pSection, return ret; } -bool Profile::ReadValue(std::string* value, const char* const pSection, +bool Profile::ReadValue(std::string* value, + const char* const pSection, const char* const pKey) const { DCHECK(value); bool ret = false; char buf[INI_LINE_LEN + 1]; *buf = '\0'; - if ((0 != ini_read_value(config_file_name_.c_str(), pSection, pKey, buf)) - && ('\0' != *buf)) { + if ((0 != ini_read_value(config_file_name_.c_str(), pSection, pKey, buf)) && + ('\0' != *buf)) { *value = buf; ret = true; } return ret; } -bool Profile::ReadStringValue(std::string* value, const char* default_value, +bool Profile::ReadStringValue(std::string* value, + const char* default_value, const char* const pSection, const char* const pKey) const { DCHECK(value); @@ -1627,7 +1731,8 @@ bool Profile::ReadStringValue(std::string* value, const char* default_value, return true; } -bool Profile::ReadIntValue(int32_t* value, const int32_t default_value, +bool Profile::ReadIntValue(int32_t* value, + const int32_t default_value, const char* const pSection, const char* const pKey) const { DCHECK(value); @@ -1640,24 +1745,26 @@ bool Profile::ReadIntValue(int32_t* value, const int32_t default_value, return true; } -bool Profile::ReadUintIntPairValue(std::pair<uint32_t, int32_t>* value, +bool Profile::ReadUintIntPairValue( + std::pair<uint32_t, int32_t>* value, const std::pair<uint32_t, uint32_t>& default_value, - const char *const pSection, - const char *const pKey) const { + const char* const pSection, + const char* const pKey) const { std::string string_value; if (!ReadValue(&string_value, pSection, pKey)) { *value = default_value; return false; } std::string first_str = string_value.substr(0, string_value.find(",")); - std::string second_str = string_value.substr(string_value.find(",") + 1, - string_value.size() - first_str.size()); + std::string second_str = string_value.substr( + string_value.find(",") + 1, string_value.size() - first_str.size()); (*value).first = strtoul(first_str.c_str(), NULL, 10); (*value).second = strtoul(second_str.c_str(), NULL, 10); return true; } -bool Profile::ReadBoolValue(bool* value, const bool default_value, +bool Profile::ReadBoolValue(bool* value, + const bool default_value, const char* const pSection, const char* const pKey) const { DCHECK(value); @@ -1672,38 +1779,41 @@ int32_t hex_to_int(const std::string& value) { } } -std::vector<int> Profile::ReadIntContainer( - const char * const pSection, const char * const pKey, - bool *out_result) const { +std::vector<int> Profile::ReadIntContainer(const char* const pSection, + const char* const pKey, + bool* out_result) const { const std::vector<std::string> string_list = ReadStringContainer(pSection, pKey, out_result); std::vector<int> value_list; value_list.resize(string_list.size()); - std::transform(string_list.begin(), string_list.end(), - value_list.begin(), hex_to_int); + std::transform( + string_list.begin(), string_list.end(), value_list.begin(), hex_to_int); return value_list; } std::vector<std::string> Profile::ReadStringContainer( - const char * const pSection, const char * const pKey, - bool *out_result) const { + const char* const pSection, + const char* const pKey, + bool* out_result) const { std::string string; const bool result = ReadValue(&string, pSection, pKey); if (out_result) *out_result = result; - std::vector < std::string > value_container; + std::vector<std::string> value_container; if (result) { std::istringstream iss(string); std::string temp_str; while (iss) { - if (!getline( iss, temp_str, ',' )) break; + if (!getline(iss, temp_str, ',')) + break; value_container.push_back(temp_str); } } return value_container; } -bool Profile::ReadUIntValue(uint16_t* value, uint16_t default_value, +bool Profile::ReadUIntValue(uint16_t* value, + uint16_t default_value, const char* const pSection, const char* const pKey) const { std::string string_value; @@ -1716,8 +1826,7 @@ bool Profile::ReadUIntValue(uint16_t* value, uint16_t default_value, *value = default_value; return false; } - if (user_value > (std::numeric_limits < uint16_t > ::max)()) - { + if (user_value > (std::numeric_limits<uint16_t>::max)()) { *value = default_value; return false; } @@ -1726,7 +1835,8 @@ bool Profile::ReadUIntValue(uint16_t* value, uint16_t default_value, } } -bool Profile::ReadUIntValue(uint32_t* value, uint32_t default_value, +bool Profile::ReadUIntValue(uint32_t* value, + uint32_t default_value, const char* const pSection, const char* const pKey) const { std::string string_value; @@ -1739,8 +1849,7 @@ bool Profile::ReadUIntValue(uint32_t* value, uint32_t default_value, *value = default_value; return false; } - if (user_value > (std::numeric_limits < uint32_t > ::max)()) - { + if (user_value > (std::numeric_limits<uint32_t>::max)()) { *value = default_value; return false; } @@ -1750,7 +1859,8 @@ bool Profile::ReadUIntValue(uint32_t* value, uint32_t default_value, } } -bool Profile::ReadUIntValue(uint64_t* value, uint64_t default_value, +bool Profile::ReadUIntValue(uint64_t* value, + uint64_t default_value, const char* const pSection, const char* const pKey) const { std::string string_value; @@ -1796,4 +1906,4 @@ void Profile::MakeAbsolutePath(std::string& path) { path = file_system::CurrentWorkingDirectory() + "/" + path; } -}// namespace profile +} // namespace profile diff --git a/src/components/config_profile/test/profile_test.cc b/src/components/config_profile/test/profile_test.cc index f9390b2ebb..59ebb2820b 100644 --- a/src/components/config_profile/test/profile_test.cc +++ b/src/components/config_profile/test/profile_test.cc @@ -52,8 +52,7 @@ class ProfileTest : public ::testing::Test { TEST_F(ProfileTest, UpdateConfigWithDefaultFile) { // Default value uint32_t thread_min_stack_size = threads::Thread::kMinStackSize; - EXPECT_EQ(thread_min_stack_size, - profile_.thread_min_stack_size()); + EXPECT_EQ(thread_min_stack_size, profile_.thread_min_stack_size()); EXPECT_FALSE(profile_.enable_policy()); std::string vr_help_title_ = ""; EXPECT_EQ(vr_help_title_, profile_.vr_help_title()); @@ -62,8 +61,7 @@ TEST_F(ProfileTest, UpdateConfigWithDefaultFile) { profile_.UpdateValues(); // Value was updated thread_min_stack_size = 20480; - EXPECT_EQ(thread_min_stack_size, - profile_.thread_min_stack_size()); + EXPECT_EQ(thread_min_stack_size, profile_.thread_min_stack_size()); EXPECT_TRUE(profile_.enable_policy()); vr_help_title_ = "Available Vr Commands List"; EXPECT_EQ(vr_help_title_, profile_.vr_help_title()); @@ -72,8 +70,7 @@ TEST_F(ProfileTest, UpdateConfigWithDefaultFile) { TEST_F(ProfileTest, SetConfigFileWithoutCallUpdate) { // Default value uint32_t thread_min_stack_size = threads::Thread::kMinStackSize; - EXPECT_EQ(thread_min_stack_size, - profile_.thread_min_stack_size()); + EXPECT_EQ(thread_min_stack_size, profile_.thread_min_stack_size()); EXPECT_FALSE(profile_.enable_policy()); std::string vr_help_title_ = ""; EXPECT_EQ(vr_help_title_, profile_.vr_help_title()); @@ -84,8 +81,7 @@ TEST_F(ProfileTest, SetConfigFileWithoutCallUpdate) { // Value was updated thread_min_stack_size = 20480; - EXPECT_EQ(thread_min_stack_size, - profile_.thread_min_stack_size()); + EXPECT_EQ(thread_min_stack_size, profile_.thread_min_stack_size()); EXPECT_TRUE(profile_.enable_policy()); vr_help_title_ = "Available Vr Commands List"; EXPECT_EQ(vr_help_title_, profile_.vr_help_title()); @@ -94,26 +90,24 @@ TEST_F(ProfileTest, SetConfigFileWithoutCallUpdate) { TEST_F(ProfileTest, SetConfigFileWithUpdate) { // Default value uint32_t thread_min_stack_size = threads::Thread::kMinStackSize; - EXPECT_EQ(thread_min_stack_size, - profile_.thread_min_stack_size()); + EXPECT_EQ(thread_min_stack_size, profile_.thread_min_stack_size()); profile_.config_file_name("smartDeviceLink.ini"); EXPECT_EQ("smartDeviceLink.ini", profile_.config_file_name()); // Value was updated thread_min_stack_size = 20480; - EXPECT_EQ(thread_min_stack_size, - profile_.thread_min_stack_size()); + EXPECT_EQ(thread_min_stack_size, profile_.thread_min_stack_size()); // Update config file again profile_.UpdateValues(); // Value should be the same - EXPECT_EQ(thread_min_stack_size, - profile_.thread_min_stack_size()); + EXPECT_EQ(thread_min_stack_size, profile_.thread_min_stack_size()); } TEST_F(ProfileTest, UpdateManyTimesDefaultFile) { - //using for check logger's work - core dump when this test was started and log4cxx exists in test derictory + // using for check logger's work - core dump when this test was started and + // log4cxx exists in test derictory profile_.config_file_name("smartDeviceLink.ini"); EXPECT_EQ("smartDeviceLink.ini", profile_.config_file_name()); // Update config many times @@ -126,8 +120,7 @@ TEST_F(ProfileTest, UpdateIntValues) { // Default value EXPECT_EQ("smartDeviceLink.ini", profile_.config_file_name()); uint32_t thread_min_stack_size = threads::Thread::kMinStackSize; - EXPECT_EQ(thread_min_stack_size, - profile_.thread_min_stack_size()); + EXPECT_EQ(thread_min_stack_size, profile_.thread_min_stack_size()); // Set config file with default name profile_.config_file_name("smartDeviceLink.ini"); @@ -135,33 +128,27 @@ TEST_F(ProfileTest, UpdateIntValues) { // Value changes thread_min_stack_size = 20480; - EXPECT_EQ(thread_min_stack_size, - profile_.thread_min_stack_size()); + EXPECT_EQ(thread_min_stack_size, profile_.thread_min_stack_size()); // Update config file again profile_.UpdateValues(); // Values are same - EXPECT_EQ(thread_min_stack_size, - profile_.thread_min_stack_size()); + EXPECT_EQ(thread_min_stack_size, profile_.thread_min_stack_size()); // Set new config file profile_.config_file_name("smartDeviceLink_test.ini"); - EXPECT_EQ("smartDeviceLink_test.ini", - profile_.config_file_name()); + EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name()); // Value changes thread_min_stack_size = 21000; - EXPECT_EQ(thread_min_stack_size, - profile_.thread_min_stack_size()); + EXPECT_EQ(thread_min_stack_size, profile_.thread_min_stack_size()); // Update config file again profile_.UpdateValues(); - EXPECT_EQ("smartDeviceLink_test.ini", - profile_.config_file_name()); + EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name()); // Value should be the same - EXPECT_EQ(thread_min_stack_size, - profile_.thread_min_stack_size()); + EXPECT_EQ(thread_min_stack_size, profile_.thread_min_stack_size()); // Set config file with default name again profile_.config_file_name("smartDeviceLink.ini"); @@ -169,8 +156,7 @@ TEST_F(ProfileTest, UpdateIntValues) { // Value should be changed thread_min_stack_size = 20480; - EXPECT_EQ(thread_min_stack_size, - profile_.thread_min_stack_size()); + EXPECT_EQ(thread_min_stack_size, profile_.thread_min_stack_size()); } TEST_F(ProfileTest, UpdateBoolValues) { @@ -195,8 +181,7 @@ TEST_F(ProfileTest, UpdateBoolValues) { // Change config file profile_.config_file_name("smartDeviceLink_test.ini"); - EXPECT_EQ("smartDeviceLink_test.ini", - profile_.config_file_name()); + EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name()); // Parameters after updating EXPECT_FALSE(profile_.launch_hmi()); @@ -250,8 +235,7 @@ TEST_F(ProfileTest, UpdateInt_ValueAppearsInFileTwice) { EXPECT_EQ(server_port, profile_.server_port()); // Change config file profile_.config_file_name("smartDeviceLink_test.ini"); - EXPECT_EQ("smartDeviceLink_test.ini", - profile_.config_file_name()); + EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name()); // Update config file // First server_port = 8088 server_port = 8088; @@ -263,8 +247,7 @@ TEST_F(ProfileTest, UpdateBool_ValueAppearsInFileTwice) { EXPECT_FALSE(profile_.is_mixing_audio_supported()); // Change config file profile_.config_file_name("smartDeviceLink_test.ini"); - EXPECT_EQ("smartDeviceLink_test.ini", - profile_.config_file_name()); + EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name()); // Update config file // First value is false EXPECT_FALSE(profile_.is_mixing_audio_supported()); @@ -272,12 +255,11 @@ TEST_F(ProfileTest, UpdateBool_ValueAppearsInFileTwice) { TEST_F(ProfileTest, UpdateVectorOfString_ValueAppearsInFileTwice) { // Default values - std::vector < std::string > time_out_promt; + std::vector<std::string> time_out_promt; EXPECT_EQ(time_out_promt, profile_.time_out_promt()); // Change config file profile_.config_file_name("smartDeviceLink_test.ini"); - EXPECT_EQ("smartDeviceLink_test.ini", - profile_.config_file_name()); + EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name()); // Update config file time_out_promt.push_back("Please say a command,"); EXPECT_EQ(time_out_promt, profile_.time_out_promt()); @@ -289,8 +271,7 @@ TEST_F(ProfileTest, UpdateString_ValueAppearsInFileTwice) { EXPECT_EQ(recording_file_name, profile_.recording_file_name()); // Change config file profile_.config_file_name("smartDeviceLink_test.ini"); - EXPECT_EQ("smartDeviceLink_test.ini", - profile_.config_file_name()); + EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name()); // Update config file recording_file_name = "video.wav"; EXPECT_EQ(recording_file_name, profile_.recording_file_name()); @@ -298,7 +279,7 @@ TEST_F(ProfileTest, UpdateString_ValueAppearsInFileTwice) { TEST_F(ProfileTest, UpdatePairsValue) { // Default values - std::pair < uint32_t, int32_t > value; + std::pair<uint32_t, int32_t> value; value.first = 0; value.second = 0; EXPECT_EQ(value, profile_.get_vehicle_data_frequency()); @@ -319,14 +300,13 @@ TEST_F(ProfileTest, UpdatePairsValue) { TEST_F(ProfileTest, PairsValueEmpty) { // Default values - std::pair < uint32_t, int32_t > value; + std::pair<uint32_t, int32_t> value; value.first = 0; value.second = 0; EXPECT_EQ(value, profile_.read_did_frequency()); profile_.config_file_name("smartDeviceLink_invalid_pairs.ini"); - EXPECT_EQ("smartDeviceLink_invalid_pairs.ini", - profile_.config_file_name()); + EXPECT_EQ("smartDeviceLink_invalid_pairs.ini", profile_.config_file_name()); // Default values value.first = 5; @@ -340,14 +320,13 @@ TEST_F(ProfileTest, PairsValueEmpty) { } TEST_F(ProfileTest, CharValueInPairInsteadOfInt) { - std::pair < uint32_t, int32_t > value; + std::pair<uint32_t, int32_t> value; value.first = 0; value.second = 0; EXPECT_EQ(value, profile_.get_vehicle_data_frequency()); profile_.config_file_name("smartDeviceLink_invalid_string.ini"); - EXPECT_EQ("smartDeviceLink_invalid_string.ini", - profile_.config_file_name()); + EXPECT_EQ("smartDeviceLink_invalid_string.ini", profile_.config_file_name()); EXPECT_EQ(value, profile_.get_vehicle_data_frequency()); @@ -359,10 +338,9 @@ TEST_F(ProfileTest, CharValueInPairInsteadOfInt) { TEST_F(ProfileTest, EmptyValuesInPair) { profile_.config_file_name("smartDeviceLink_invalid_pairs.ini"); - EXPECT_EQ("smartDeviceLink_invalid_pairs.ini", - profile_.config_file_name()); + EXPECT_EQ("smartDeviceLink_invalid_pairs.ini", profile_.config_file_name()); - std::pair < uint32_t, int32_t > value; + std::pair<uint32_t, int32_t> value; value.first = 0; value.second = 0; EXPECT_EQ(value, profile_.get_vehicle_data_frequency()); @@ -375,14 +353,13 @@ TEST_F(ProfileTest, EmptyValuesInPair) { TEST_F(ProfileTest, IntInsteadOfPair) { // Default values - std::pair < uint32_t, int32_t > value; + std::pair<uint32_t, int32_t> value; value.first = 0; value.second = 0; EXPECT_EQ(value, profile_.start_stream_retry_amount()); profile_.config_file_name("smartDeviceLink_invalid_pairs.ini"); - EXPECT_EQ("smartDeviceLink_invalid_pairs.ini", - profile_.config_file_name()); + EXPECT_EQ("smartDeviceLink_invalid_pairs.ini", profile_.config_file_name()); // Ini file includes only one element value.first = 9; value.second = 0; @@ -401,8 +378,7 @@ TEST_F(ProfileTest, WrongIntValue) { // Change config file profile_.config_file_name("smartDeviceLink_invalid_int.ini"); - EXPECT_EQ("smartDeviceLink_invalid_int.ini", - profile_.config_file_name()); + EXPECT_EQ("smartDeviceLink_invalid_int.ini", profile_.config_file_name()); // Value in file includes letters. Check that value is default heart_beat_timeout = 0; @@ -420,8 +396,7 @@ TEST_F(ProfileTest, WrongMaxIntValue) { // Change config file profile_.config_file_name("smartDeviceLink_invalid_int.ini"); - EXPECT_EQ("smartDeviceLink_invalid_int.ini", - profile_.config_file_name()); + EXPECT_EQ("smartDeviceLink_invalid_int.ini", profile_.config_file_name()); // Value in file is more than could be saved. // Check that value is default @@ -442,12 +417,11 @@ TEST_F(ProfileTest, WrongMinIntValue) { // Change config file profile_.config_file_name("smartDeviceLink_invalid_int.ini"); - EXPECT_EQ("smartDeviceLink_invalid_int.ini", - profile_.config_file_name()); + EXPECT_EQ("smartDeviceLink_invalid_int.ini", profile_.config_file_name()); - //File include 0, value should be lefted as default + // File include 0, value should be lefted as default EXPECT_EQ(minvalue, profile_.thread_min_stack_size()); - //File include -1, value should be lefted as default + // File include -1, value should be lefted as default EXPECT_EQ(server_port, profile_.server_port()); // Update config file @@ -464,13 +438,11 @@ TEST_F(ProfileTest, CheckCorrectValueWhenOtherValueInvalid) { EXPECT_EQ(maxvalue, profile_.max_cmd_id()); uint32_t thread_min_stack_size = threads::Thread::kMinStackSize; - EXPECT_EQ(thread_min_stack_size, - profile_.thread_min_stack_size()); + EXPECT_EQ(thread_min_stack_size, profile_.thread_min_stack_size()); // Change config file profile_.config_file_name("smartDeviceLink_test.ini"); - EXPECT_EQ("smartDeviceLink_test.ini", - profile_.config_file_name()); + EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name()); // Check that value is default maxvalue = 2000000000; @@ -478,23 +450,20 @@ TEST_F(ProfileTest, CheckCorrectValueWhenOtherValueInvalid) { // Other value is correct thread_min_stack_size = 21000; - EXPECT_EQ(thread_min_stack_size, - profile_.thread_min_stack_size()); + EXPECT_EQ(thread_min_stack_size, profile_.thread_min_stack_size()); // Update config file profile_.UpdateValues(); // In file the number is bigger than can be, default value should be lefted EXPECT_EQ(maxvalue, profile_.max_cmd_id()); - EXPECT_EQ(thread_min_stack_size, - profile_.thread_min_stack_size()); + EXPECT_EQ(thread_min_stack_size, profile_.thread_min_stack_size()); } TEST_F(ProfileTest, PairsValueInsteadOfInt) { // Set new config file profile_.config_file_name("smartDeviceLink_invalid_int.ini"); - EXPECT_EQ("smartDeviceLink_invalid_int.ini", - profile_.config_file_name()); + EXPECT_EQ("smartDeviceLink_invalid_int.ini", profile_.config_file_name()); // Get first number uint32_t list_files_in_none = 5; EXPECT_EQ(list_files_in_none, profile_.list_files_in_none()); @@ -514,8 +483,7 @@ TEST_F(ProfileTest, StringValueIncludeSlashesAndRussianLetters) { std::string current_dir = file_system::CurrentWorkingDirectory(); profile_.config_file_name("smartDeviceLink_invalid_string.ini"); - EXPECT_EQ("smartDeviceLink_invalid_string.ini", - profile_.config_file_name()); + EXPECT_EQ("smartDeviceLink_invalid_string.ini", profile_.config_file_name()); // Check values tts_delimiter_ = "coma and point"; @@ -523,7 +491,7 @@ TEST_F(ProfileTest, StringValueIncludeSlashesAndRussianLetters) { std::string server_address = "127.0.0.1 + слово"; EXPECT_EQ(server_address, profile_.server_address()); app_storage_folder = "/\" \""; - EXPECT_EQ(current_dir+app_storage_folder, profile_.app_storage_folder()); + EXPECT_EQ(current_dir + app_storage_folder, profile_.app_storage_folder()); // Update config file profile_.UpdateValues(); @@ -541,16 +509,30 @@ TEST_F(ProfileTest, StringUpperBoundValue) { EXPECT_EQ(recording_file_name, profile_.recording_file_name()); profile_.config_file_name("smartDeviceLink_invalid_string.ini"); - EXPECT_EQ("smartDeviceLink_invalid_string.ini", - profile_.config_file_name()); + EXPECT_EQ("smartDeviceLink_invalid_string.ini", profile_.config_file_name()); // Total count of elements in ini file's string will be less 512 vr_help_title = - "0/0/0/1/2345678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012345678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012345678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012345678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012345678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890abc!def@ghi"; + "0/0/0/1/" + "2345678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~" + "STU{}WXY[]Z,01234567890a00012345678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:" + "yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012345678'90abc!" + "def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z," + "01234567890a00012345678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_" + "GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012345678'90abc!def@ghi#jkl$" + "mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890abc!" + "def@ghi"; EXPECT_EQ(vr_help_title, profile_.vr_help_title()); EXPECT_NE(vr_help_title, profile_.recording_file_name()); recording_file_name = - "0/0/0/1/2345678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012345678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012345678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012345678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012345678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890abc"; + "0/0/0/1/" + "2345678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~" + "STU{}WXY[]Z,01234567890a00012345678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:" + "yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012345678'90abc!" + "def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z," + "01234567890a00012345678'90abc!def@ghi#jkl$mno%pqr^stu*vwx:yz()ABC-DEF_" + "GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890a00012345678'90abc!def@ghi#jkl$" + "mno%pqr^stu*vwx:yz()ABC-DEF_GHIJKL+MNO|PQR~STU{}WXY[]Z,01234567890abc"; EXPECT_EQ(recording_file_name, profile_.recording_file_name()); // Update config file profile_.UpdateValues(); @@ -574,8 +556,7 @@ TEST_F(ProfileTest, CapitalLetterInBoolValue) { // Change config file profile_.config_file_name("smartDeviceLink_invalid_boolean.ini"); - EXPECT_EQ("smartDeviceLink_invalid_boolean.ini", - profile_.config_file_name()); + EXPECT_EQ("smartDeviceLink_invalid_boolean.ini", profile_.config_file_name()); // Parameters after updating // Parameter launch_hmi = True @@ -589,49 +570,41 @@ TEST_F(ProfileTest, CapitalLetterInBoolValue) { TEST_F(ProfileTest, CheckReadStringValue) { // Set new config file profile_.config_file_name("smartDeviceLink_test.ini"); - EXPECT_EQ("smartDeviceLink_test.ini", - profile_.config_file_name()); + EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name()); std::string app_storage_folder_; profile_.ReadStringValue( - &app_storage_folder_, "", - "MAIN", "AppStorageFolder"); + &app_storage_folder_, "", "MAIN", "AppStorageFolder"); // Get default value EXPECT_EQ("storage", app_storage_folder_); // Get value from file std::string server_address; - profile_.ReadStringValue(&server_address, "", "HMI", - "ServerAddress"); + profile_.ReadStringValue(&server_address, "", "HMI", "ServerAddress"); EXPECT_EQ("127.0.0.1", server_address); } TEST_F(ProfileTest, CheckReadBoolValue) { // Set new config file profile_.config_file_name("smartDeviceLink_test.ini"); - EXPECT_EQ("smartDeviceLink_test.ini", - profile_.config_file_name()); + EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name()); bool enable_policy; - profile_.ReadBoolValue(&enable_policy, false, "Policy", - "EnablePolicy"); + profile_.ReadBoolValue(&enable_policy, false, "Policy", "EnablePolicy"); EXPECT_FALSE(enable_policy); bool use_last_state; - profile_.ReadBoolValue(&use_last_state, true, "MAIN", - "UseLastState"); + profile_.ReadBoolValue(&use_last_state, true, "MAIN", "UseLastState"); EXPECT_TRUE(use_last_state); } TEST_F(ProfileTest, CheckReadIntValue) { // Set new config file profile_.config_file_name("smartDeviceLink_test.ini"); - EXPECT_EQ("smartDeviceLink_test.ini", - profile_.config_file_name()); + EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name()); int server_port = 0; - profile_.ReadIntValue(&server_port, 0, "HMI", - "ServerPort"); + profile_.ReadIntValue(&server_port, 0, "HMI", "ServerPort"); EXPECT_EQ(8088, server_port); } @@ -639,18 +612,15 @@ TEST_F(ProfileTest, CheckReadIntValue) { TEST_F(ProfileTest, CheckIntContainer) { // Set new config file profile_.config_file_name("smartDeviceLink_test.ini"); - EXPECT_EQ("smartDeviceLink_test.ini", - profile_.config_file_name()); + EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name()); bool isread = false; std::vector<int> diagmodes_list = - profile_.ReadIntContainer("MAIN", - "SupportedDiagModes", - &isread); + profile_.ReadIntContainer("MAIN", "SupportedDiagModes", &isread); EXPECT_TRUE(isread); - std::vector<int>::iterator diag_mode = std::find(diagmodes_list.begin(), - diagmodes_list.end(), 0x12); + std::vector<int>::iterator diag_mode = + std::find(diagmodes_list.begin(), diagmodes_list.end(), 0x12); // This element doesn't appear in list EXPECT_EQ(diag_mode, diagmodes_list.end()); @@ -670,17 +640,14 @@ TEST_F(ProfileTest, CheckIntContainer) { TEST_F(ProfileTest, CheckVectorContainer) { profile_.config_file_name("smartDeviceLink_test.ini"); - EXPECT_EQ("smartDeviceLink_test.ini", - profile_.config_file_name()); + EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name()); // Get diag_modes after updating - const std::vector<uint32_t> &diag_modes = profile_.supported_diag_modes(); + const std::vector<uint32_t>& diag_modes = profile_.supported_diag_modes(); bool isread = false; std::vector<int> diagmodes_list = - profile_.ReadIntContainer("MAIN", - "SupportedDiagModes", - &isread); + profile_.ReadIntContainer("MAIN", "SupportedDiagModes", &isread); EXPECT_TRUE(isread); // Compare with result of ReadIntContainer ASSERT_EQ(diag_modes.size(), diagmodes_list.size()); @@ -688,8 +655,8 @@ TEST_F(ProfileTest, CheckVectorContainer) { std::vector<int>::iterator iter = diagmodes_list.begin(); for (std::vector<uint32_t>::const_iterator it = diag_modes.begin(); - it != diag_modes.end(); it++) { - + it != diag_modes.end(); + it++) { if ((uint32_t)(*iter) != (*it)) { isEqual = false; break; @@ -702,12 +669,11 @@ TEST_F(ProfileTest, CheckVectorContainer) { TEST_F(ProfileTest, CheckStringContainer) { // Set new config file profile_.config_file_name("smartDeviceLink_test.ini"); - EXPECT_EQ("smartDeviceLink_test.ini", - profile_.config_file_name()); + EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name()); bool isread = false; - std::vector < std::string > diagmodes_list = - profile_.ReadStringContainer("MAIN", "SupportedDiagModes", &isread); + std::vector<std::string> diagmodes_list = + profile_.ReadStringContainer("MAIN", "SupportedDiagModes", &isread); EXPECT_TRUE(isread); std::vector<std::string>::iterator diag_mode = @@ -732,31 +698,32 @@ TEST_F(ProfileTest, CheckStringContainer) { TEST_F(ProfileTest, CheckIntContainerInSecurityData) { // Set new config file profile_.config_file_name("smartDeviceLink_test.ini"); - EXPECT_EQ("smartDeviceLink_test.ini", - profile_.config_file_name()); + EXPECT_EQ("smartDeviceLink_test.ini", profile_.config_file_name()); - std::vector<int> force_unprotected_list = - profile_.ReadIntContainer( + std::vector<int> force_unprotected_list = profile_.ReadIntContainer( "Security Manager", "ForceUnprotectedService", NULL); - std::vector<int> force_protected_list = - profile_.ReadIntContainer( + std::vector<int> force_protected_list = profile_.ReadIntContainer( "Security Manager", "ForceProtectedService", NULL); - std::vector<int>::iterator res_unprotect = std::find(force_unprotected_list.begin(), force_unprotected_list.end(), 0x07); - std::vector<int>::iterator res_protect = std::find(force_protected_list.begin(), force_protected_list.end(), 0x07); + std::vector<int>::iterator res_unprotect = std::find( + force_unprotected_list.begin(), force_unprotected_list.end(), 0x07); + std::vector<int>::iterator res_protect = + std::find(force_protected_list.begin(), force_protected_list.end(), 0x07); // This element doesn't appear in both lists - EXPECT_EQ(res_unprotect, force_unprotected_list.end() ); - EXPECT_EQ(res_protect, force_protected_list.end() ); + EXPECT_EQ(res_unprotect, force_unprotected_list.end()); + EXPECT_EQ(res_protect, force_protected_list.end()); // Both lists include 0 - res_unprotect = std::find(force_unprotected_list.begin(), force_unprotected_list.end(), 0); - res_protect = std::find(force_protected_list.begin(), force_protected_list.end(), 0); - EXPECT_EQ(res_unprotect, force_unprotected_list.begin() ); - EXPECT_EQ(res_protect, force_protected_list.begin() ); + res_unprotect = std::find( + force_unprotected_list.begin(), force_unprotected_list.end(), 0); + res_protect = + std::find(force_protected_list.begin(), force_protected_list.end(), 0); + EXPECT_EQ(res_unprotect, force_unprotected_list.begin()); + EXPECT_EQ(res_protect, force_protected_list.begin()); } #endif -} // namespace profile -} // namespace components -} // namespace test +} // namespace profile +} // namespace components +} // namespace test diff --git a/src/components/connection_handler/test/heart_beat_monitor_test.cc b/src/components/connection_handler/test/heart_beat_monitor_test.cc index 331a83c8d4..2c928fe458 100644 --- a/src/components/connection_handler/test/heart_beat_monitor_test.cc +++ b/src/components/connection_handler/test/heart_beat_monitor_test.cc @@ -67,10 +67,14 @@ class HeartBeatMonitorTest : public testing::Test { kConnectionHandle, 0, &connection_handler_mock, kTimeout); } - void TearDown() OVERRIDE { delete conn; } + void TearDown() OVERRIDE { + delete conn; + } }; -ACTION_P2(RemoveSession, conn, session_id) { conn->RemoveSession(session_id); } +ACTION_P2(RemoveSession, conn, session_id) { + conn->RemoveSession(session_id); +} TEST_F(HeartBeatMonitorTest, TimerNotStarted) { // Whithout StartHeartBeat nothing to be call @@ -79,7 +83,8 @@ TEST_F(HeartBeatMonitorTest, TimerNotStarted) { EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, _)).Times(0); conn->AddNewSession(); - testing::Mock::AsyncVerifyAndClearExpectations(kTimeout * MICROSECONDS_IN_MILLISECONDS + MICROSECONDS_IN_SECOND); + testing::Mock::AsyncVerifyAndClearExpectations( + kTimeout * MICROSECONDS_IN_MILLISECONDS + MICROSECONDS_IN_SECOND); } TEST_F(HeartBeatMonitorTest, TimerNotElapsed) { @@ -89,7 +94,8 @@ TEST_F(HeartBeatMonitorTest, TimerNotElapsed) { const uint32_t session = conn->AddNewSession(); conn->StartHeartBeat(session); - testing::Mock::AsyncVerifyAndClearExpectations(kTimeout * MICROSECONDS_IN_MILLISECONDS - MICROSECONDS_IN_SECOND); + testing::Mock::AsyncVerifyAndClearExpectations( + kTimeout * MICROSECONDS_IN_MILLISECONDS - MICROSECONDS_IN_SECOND); } TEST_F(HeartBeatMonitorTest, TimerElapsed) { @@ -101,7 +107,8 @@ TEST_F(HeartBeatMonitorTest, TimerElapsed) { EXPECT_CALL(connection_handler_mock, SendHeartBeat(_, session)); conn->StartHeartBeat(session); - testing::Mock::AsyncVerifyAndClearExpectations(2 * kTimeout * MICROSECONDS_IN_MILLISECONDS + MICROSECONDS_IN_SECOND); + testing::Mock::AsyncVerifyAndClearExpectations( + 2 * kTimeout * MICROSECONDS_IN_MILLISECONDS + MICROSECONDS_IN_SECOND); } TEST_F(HeartBeatMonitorTest, KeptAlive) { @@ -152,7 +159,8 @@ TEST_F(HeartBeatMonitorTest, TwoSessionsElapsed) { conn->StartHeartBeat(kSession1); conn->StartHeartBeat(kSession2); - testing::Mock::AsyncVerifyAndClearExpectations(2 * kTimeout * MICROSECONDS_IN_MILLISECONDS + MICROSECONDS_IN_SECOND); + testing::Mock::AsyncVerifyAndClearExpectations( + 2 * kTimeout * MICROSECONDS_IN_MILLISECONDS + MICROSECONDS_IN_SECOND); } TEST_F(HeartBeatMonitorTest, IncreaseHeartBeatTimeout) { @@ -166,7 +174,8 @@ TEST_F(HeartBeatMonitorTest, IncreaseHeartBeatTimeout) { conn->StartHeartBeat(kSession); conn->SetHeartBeatTimeout(kNewTimeout, kSession); // new timeout greater by old timeout so mock object shouldn't be invoked - testing::Mock::AsyncVerifyAndClearExpectations(kTimeout * MICROSECONDS_IN_MILLISECONDS); + testing::Mock::AsyncVerifyAndClearExpectations(kTimeout * + MICROSECONDS_IN_MILLISECONDS); } TEST_F(HeartBeatMonitorTest, DecreaseHeartBeatTimeout) { @@ -181,7 +190,8 @@ TEST_F(HeartBeatMonitorTest, DecreaseHeartBeatTimeout) { conn->StartHeartBeat(kSession); conn->SetHeartBeatTimeout(kNewTimeout, kSession); // new timeout less than old timeout so mock object should be invoked - testing::Mock::AsyncVerifyAndClearExpectations(kTimeout * 2 * MICROSECONDS_IN_MILLISECONDS); + testing::Mock::AsyncVerifyAndClearExpectations(kTimeout * 2 * + MICROSECONDS_IN_MILLISECONDS); } } // namespace connection_handler_test diff --git a/src/components/dbus/test/test_dbus_message_controller.cc b/src/components/dbus/test/test_dbus_message_controller.cc index a81817e80b..5c5d4e69d5 100644 --- a/src/components/dbus/test/test_dbus_message_controller.cc +++ b/src/components/dbus/test/test_dbus_message_controller.cc @@ -66,13 +66,9 @@ class DBusMessageControllerTest : public ::testing::Test { MockDBusMessageController* controller_; MockSubscriber* subscriber_; - static void SetUpTestCase() { + static void SetUpTestCase() {} - } - - static void TearDownTestCase() { - - } + static void TearDownTestCase() {} virtual void SetUp() { const std::string kService = "sdl.core.test_api"; @@ -94,7 +90,8 @@ class DBusMessageControllerTest : public ::testing::Test { timespec elapsed; clock_gettime(CLOCK_REALTIME, &elapsed); elapsed.tv_sec += seconds; - return pthread_cond_timedwait(&test_cond, &test_mutex, &elapsed) != ETIMEDOUT; + return pthread_cond_timedwait(&test_cond, &test_mutex, &elapsed) != + ETIMEDOUT; } }; @@ -110,12 +107,10 @@ TEST_F(DBusMessageControllerTest, Receive) { TEST_F(DBusMessageControllerTest, DISABLED_Send) { const std::string kText = "Test message for signal DBus"; -// EXPECT_CALL(*subscriber_, Receive(kText)).Times(1); + // EXPECT_CALL(*subscriber_, Receive(kText)).Times(1); controller_->Send(kText); } } // namespace hmi_message_handler } // namespace components } // namespace test - - diff --git a/src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc b/src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc index ff33bbef9b..06cca74ba9 100644 --- a/src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc +++ b/src/components/hmi_message_handler/test/hmi_message_handler_impl_test.cc @@ -46,16 +46,17 @@ using ::testing::ReturnRef; class HMIMessageHandlerImplTest : public ::testing::Test { public: HMIMessageHandlerImplTest() - : mb_adapter_(NULL), - hmi_handler_(NULL), - mock_hmi_message_observer_(NULL) {} + : mb_adapter_(NULL) + , hmi_handler_(NULL) + , mock_hmi_message_observer_(NULL) {} protected: hmi_message_handler::MessageBrokerAdapter* mb_adapter_; hmi_message_handler::HMIMessageHandlerImpl* hmi_handler_; hmi_message_handler::MockHMIMessageObserver* mock_hmi_message_observer_; - testing::NiceMock<MockHMIMessageHandlerSettings> mock_hmi_message_handler_settings; - const uint64_t stack_size =1000u; + testing::NiceMock<MockHMIMessageHandlerSettings> + mock_hmi_message_handler_settings; + const uint64_t stack_size = 1000u; virtual void SetUp() OVERRIDE { ON_CALL(mock_hmi_message_handler_settings, thread_min_stack_size()) diff --git a/src/components/include/application_manager/policies/policy_handler_interface.h b/src/components/include/application_manager/policies/policy_handler_interface.h index 9bf9fccb78..ef3044c0ba 100644 --- a/src/components/include/application_manager/policies/policy_handler_interface.h +++ b/src/components/include/application_manager/policies/policy_handler_interface.h @@ -72,7 +72,8 @@ class PolicyHandlerInterface { virtual bool GetPriority(const std::string& policy_app_id, std::string* priority) const = 0; virtual void CheckPermissions(const PTString& app_id, - const PTString& hmi_level, const PTString& rpc, + const PTString& hmi_level, + const PTString& rpc, const RPCParams& rpc_params, CheckPermissionResult& result) = 0; @@ -182,7 +183,8 @@ class PolicyHandlerInterface { */ virtual void OnGetUserFriendlyMessage( const std::vector<std::string>& message_codes, - const std::string& language, uint32_t correlation_id) = 0; + const std::string& language, + uint32_t correlation_id) = 0; /** * @brief Get list of permissions for application/device binded to @@ -361,7 +363,8 @@ class PolicyHandlerInterface { virtual void Increment(usage_statistics::GlobalCounterId type) = 0; virtual void Increment(const std::string& app_id, usage_statistics::AppCounterId type) = 0; - virtual void Set(const std::string& app_id, usage_statistics::AppInfoId type, + virtual void Set(const std::string& app_id, + usage_statistics::AppInfoId type, const std::string& value) = 0; virtual void Add(const std::string& app_id, usage_statistics::AppStopwatchId type, @@ -375,10 +378,10 @@ class PolicyHandlerInterface { virtual const std::string RemoteAppsUrl() const = 0; private: - virtual void OnAppPermissionConsentInternal(const uint32_t connection_key, - PermissionConsent& permissions) =0; + virtual void OnAppPermissionConsentInternal( + const uint32_t connection_key, PermissionConsent& permissions) = 0; - friend class AppPermissionDelegate; + friend class AppPermissionDelegate; }; } // namespace policy diff --git a/src/components/include/application_manager/request_controller_settings.h b/src/components/include/application_manager/request_controller_settings.h index 420ffd8aaf..297b3f7ba1 100644 --- a/src/components/include/application_manager/request_controller_settings.h +++ b/src/components/include/application_manager/request_controller_settings.h @@ -35,7 +35,7 @@ namespace application_manager { class RequestControlerSettings { -public: + public: virtual uint32_t thread_pool_size() const = 0; virtual const uint32_t& app_hmi_level_none_time_scale() const = 0; virtual const uint32_t& app_hmi_level_none_time_scale_max_requests() diff --git a/src/components/include/application_manager/state_controller.h b/src/components/include/application_manager/state_controller.h index 9cec3eb639..2fe0492b42 100644 --- a/src/components/include/application_manager/state_controller.h +++ b/src/components/include/application_manager/state_controller.h @@ -41,11 +41,13 @@ namespace application_manager { class StateController { public: - virtual void SetRegularState(ApplicationSharedPtr app, HmiStatePtr state, + virtual void SetRegularState(ApplicationSharedPtr app, + HmiStatePtr state, const bool SendActivateApp) = 0; virtual void SetRegularState( - ApplicationSharedPtr app, const mobile_apis::HMILevel::eType hmi_level, + ApplicationSharedPtr app, + const mobile_apis::HMILevel::eType hmi_level, const mobile_apis::AudioStreamingState::eType audio_state, const bool SendActivateApp) = 0; @@ -53,7 +55,8 @@ class StateController { const mobile_apis::HMILevel::eType hmi_level, const bool SendActivateApp) = 0; virtual void SetRegularState( - ApplicationSharedPtr app, const mobile_apis::HMILevel::eType hmi_level, + ApplicationSharedPtr app, + const mobile_apis::HMILevel::eType hmi_level, const mobile_apis::AudioStreamingState::eType audio_state, const mobile_apis::SystemContext::eType system_context, const bool SendActivateApp) = 0; @@ -82,7 +85,8 @@ class StateController { virtual void OnNaviStreamingStarted() = 0; virtual void OnNaviStreamingStopped() = 0; - virtual void OnStateChanged(ApplicationSharedPtr app, HmiStatePtr old_state, + virtual void OnStateChanged(ApplicationSharedPtr app, + HmiStatePtr old_state, HmiStatePtr new_state) = 0; virtual bool IsStateActive(HmiState::StateID state_id) const = 0; diff --git a/src/components/include/policy/usage_statistics/statistics_manager.h b/src/components/include/policy/usage_statistics/statistics_manager.h index 38d93377c7..2b2c875d11 100644 --- a/src/components/include/policy/usage_statistics/statistics_manager.h +++ b/src/components/include/policy/usage_statistics/statistics_manager.h @@ -38,16 +38,9 @@ namespace usage_statistics { -enum GlobalCounterId { - IAP_BUFFER_FULL, - SYNC_OUT_OF_MEMORY, - SYNC_REBOOTS -}; +enum GlobalCounterId { IAP_BUFFER_FULL, SYNC_OUT_OF_MEMORY, SYNC_REBOOTS }; -enum AppInfoId { - LANGUAGE_GUI, - LANGUAGE_VUI -}; +enum AppInfoId { LANGUAGE_GUI, LANGUAGE_VUI }; enum AppStopwatchId { SECONDS_HMI_FULL, @@ -73,7 +66,8 @@ class StatisticsManager { virtual ~StatisticsManager() {} virtual void Increment(GlobalCounterId type) = 0; virtual void Increment(const std::string& app_id, AppCounterId type) = 0; - virtual void Set(const std::string& app_id, AppInfoId type, + virtual void Set(const std::string& app_id, + AppInfoId type, const std::string& value) = 0; virtual void Add(const std::string& app_id, AppStopwatchId type, diff --git a/src/components/include/test/application_manager/mock_application_manager_settings.h b/src/components/include/test/application_manager/mock_application_manager_settings.h index 02e33e2c7f..b1c32c982b 100644 --- a/src/components/include/test/application_manager/mock_application_manager_settings.h +++ b/src/components/include/test/application_manager/mock_application_manager_settings.h @@ -44,127 +44,75 @@ namespace application_manager_test { class MockApplicationManagerSettings : public application_manager::ApplicationManagerSettings { public: - MOCK_CONST_METHOD0(video_data_stopped_timeout, - const uint32_t()); - MOCK_CONST_METHOD0(audio_data_stopped_timeout, - const std::uint32_t()); + MOCK_CONST_METHOD0(video_data_stopped_timeout, const uint32_t()); + MOCK_CONST_METHOD0(audio_data_stopped_timeout, const std::uint32_t()); // The following line won't really compile, as the return // type has multiple template arguments. To fix it, use a // typedef for the return type. - MOCK_CONST_METHOD0(read_did_frequency, - const std::pair<uint32_t, int32_t>&()); + MOCK_CONST_METHOD0(read_did_frequency, const std::pair<uint32_t, int32_t>&()); // The following line won't really compile, as the return // type has multiple template arguments. To fix it, use a // typedef for the return type. MOCK_CONST_METHOD0(get_vehicle_data_frequency, - const std::pair<uint32_t, int32_t>&()); - MOCK_CONST_METHOD0(hash_string_size, - uint32_t()); - MOCK_CONST_METHOD0(app_storage_folder, - const std::string&()); - MOCK_CONST_METHOD0(app_dir_quota, - const uint32_t&()); - MOCK_CONST_METHOD0(stop_streaming_timeout, - uint32_t()); - MOCK_CONST_METHOD0(application_list_update_timeout, - uint32_t()); - MOCK_CONST_METHOD0(heart_beat_timeout, - uint32_t()); - MOCK_CONST_METHOD0(recording_file_name, - const std::string&()); - MOCK_CONST_METHOD0(system_files_path, - const std::string&()); - MOCK_CONST_METHOD0(is_mixing_audio_supported, - bool()); - MOCK_CONST_METHOD0(tts_global_properties_timeout, - uint16_t()); - MOCK_CONST_METHOD0(max_supported_protocol_version, - uint16_t()); - MOCK_CONST_METHOD0(default_timeout, - const uint32_t&()); - MOCK_CONST_METHOD0(max_cmd_id, - const uint32_t&()); - MOCK_CONST_METHOD0(launch_hmi, - bool()); - MOCK_CONST_METHOD0(delete_file_in_none, - const uint32_t&()); - MOCK_CONST_METHOD0(supported_diag_modes, - const std::vector<uint32_t>&()); - MOCK_CONST_METHOD0(list_files_in_none, - const uint32_t&()); - MOCK_CONST_METHOD0(tts_delimiter, - const std::string&()); - MOCK_CONST_METHOD0(put_file_in_none, - const uint32_t&()); - MOCK_CONST_METHOD0(sdl_version, - const std::string&()); - MOCK_CONST_METHOD0(time_out_promt, - const std::vector<std::string>&()); - MOCK_CONST_METHOD0(hmi_capabilities_file_name, - const std::string&()); - MOCK_CONST_METHOD0(video_server_type, - const std::string&()); - MOCK_CONST_METHOD0(audio_server_type, - const std::string&()); - MOCK_CONST_METHOD0(server_address, - const std::string&()); - MOCK_CONST_METHOD0(video_streaming_port, - const uint16_t()); - MOCK_CONST_METHOD0(audio_streaming_port, - const uint16_t()); - MOCK_CONST_METHOD0(named_video_pipe_path, - const std::string&()); - MOCK_CONST_METHOD0(named_audio_pipe_path, - const std::string&()); - MOCK_CONST_METHOD0(video_stream_file, - const std::string&()); - MOCK_CONST_METHOD0(audio_stream_file, - const std::string&()); - MOCK_CONST_METHOD0(use_db_for_resumption, - bool()); + const std::pair<uint32_t, int32_t>&()); + MOCK_CONST_METHOD0(hash_string_size, uint32_t()); + MOCK_CONST_METHOD0(app_storage_folder, const std::string&()); + MOCK_CONST_METHOD0(app_dir_quota, const uint32_t&()); + MOCK_CONST_METHOD0(stop_streaming_timeout, uint32_t()); + MOCK_CONST_METHOD0(application_list_update_timeout, uint32_t()); + MOCK_CONST_METHOD0(heart_beat_timeout, uint32_t()); + MOCK_CONST_METHOD0(recording_file_name, const std::string&()); + MOCK_CONST_METHOD0(system_files_path, const std::string&()); + MOCK_CONST_METHOD0(is_mixing_audio_supported, bool()); + MOCK_CONST_METHOD0(tts_global_properties_timeout, uint16_t()); + MOCK_CONST_METHOD0(max_supported_protocol_version, uint16_t()); + MOCK_CONST_METHOD0(default_timeout, const uint32_t&()); + MOCK_CONST_METHOD0(max_cmd_id, const uint32_t&()); + MOCK_CONST_METHOD0(launch_hmi, bool()); + MOCK_CONST_METHOD0(delete_file_in_none, const uint32_t&()); + MOCK_CONST_METHOD0(supported_diag_modes, const std::vector<uint32_t>&()); + MOCK_CONST_METHOD0(list_files_in_none, const uint32_t&()); + MOCK_CONST_METHOD0(tts_delimiter, const std::string&()); + MOCK_CONST_METHOD0(put_file_in_none, const uint32_t&()); + MOCK_CONST_METHOD0(sdl_version, const std::string&()); + MOCK_CONST_METHOD0(time_out_promt, const std::vector<std::string>&()); + MOCK_CONST_METHOD0(hmi_capabilities_file_name, const std::string&()); + MOCK_CONST_METHOD0(video_server_type, const std::string&()); + MOCK_CONST_METHOD0(audio_server_type, const std::string&()); + MOCK_CONST_METHOD0(server_address, const std::string&()); + MOCK_CONST_METHOD0(video_streaming_port, const uint16_t()); + MOCK_CONST_METHOD0(audio_streaming_port, const uint16_t()); + MOCK_CONST_METHOD0(named_video_pipe_path, const std::string&()); + MOCK_CONST_METHOD0(named_audio_pipe_path, const std::string&()); + MOCK_CONST_METHOD0(video_stream_file, const std::string&()); + MOCK_CONST_METHOD0(audio_stream_file, const std::string&()); + MOCK_CONST_METHOD0(use_db_for_resumption, bool()); MOCK_CONST_METHOD0(app_resumption_save_persistent_data_timeout, - const uint32_t&()); - MOCK_CONST_METHOD0(resumption_delay_before_ign, - uint32_t()); - MOCK_CONST_METHOD0(resumption_delay_after_ign, - uint32_t()); - MOCK_CONST_METHOD0(app_resuming_timeout, - const uint32_t&()); - MOCK_CONST_METHOD0(attempts_to_open_resumption_db, - uint16_t()); - MOCK_CONST_METHOD0(open_attempt_timeout_ms_resumption_db, - uint16_t()); - MOCK_METHOD1(config_file_name, - void(const std::string& fileName)); + const uint32_t&()); + MOCK_CONST_METHOD0(resumption_delay_before_ign, uint32_t()); + MOCK_CONST_METHOD0(resumption_delay_after_ign, uint32_t()); + MOCK_CONST_METHOD0(app_resuming_timeout, const uint32_t&()); + MOCK_CONST_METHOD0(attempts_to_open_resumption_db, uint16_t()); + MOCK_CONST_METHOD0(open_attempt_timeout_ms_resumption_db, uint16_t()); + MOCK_METHOD1(config_file_name, void(const std::string& fileName)); // The following line won't really compile, as the return // type has multiple template arguments. To fix it, use a // typedef for the return type. MOCK_CONST_METHOD0(start_stream_retry_amount, - const std::pair<uint32_t, int32_t>&()); - MOCK_CONST_METHOD0(app_icons_folder, - const std::string&()); - MOCK_CONST_METHOD0(app_icons_folder_max_size, - const uint32_t&()); - MOCK_CONST_METHOD0(app_icons_amount_to_remove, - const uint32_t&()); - MOCK_CONST_METHOD0(list_files_response_size, - const uint32_t&()); - + const std::pair<uint32_t, int32_t>&()); + MOCK_CONST_METHOD0(app_icons_folder, const std::string&()); + MOCK_CONST_METHOD0(app_icons_folder_max_size, const uint32_t&()); + MOCK_CONST_METHOD0(app_icons_amount_to_remove, const uint32_t&()); + MOCK_CONST_METHOD0(list_files_response_size, const uint32_t&()); // request controller settings section - MOCK_CONST_METHOD0(thread_pool_size, - uint32_t()); - MOCK_CONST_METHOD0(app_hmi_level_none_time_scale, - const uint32_t&()); + MOCK_CONST_METHOD0(thread_pool_size, uint32_t()); + MOCK_CONST_METHOD0(app_hmi_level_none_time_scale, const uint32_t&()); MOCK_CONST_METHOD0(app_hmi_level_none_time_scale_max_requests, - const uint32_t&()); - MOCK_CONST_METHOD0(app_time_scale, - const uint32_t&()); - MOCK_CONST_METHOD0(app_time_scale_max_requests, - const uint32_t&()); - MOCK_CONST_METHOD0(pending_requests_amount, - const uint32_t&()); - + const uint32_t&()); + MOCK_CONST_METHOD0(app_time_scale, const uint32_t&()); + MOCK_CONST_METHOD0(app_time_scale_max_requests, const uint32_t&()); + MOCK_CONST_METHOD0(pending_requests_amount, const uint32_t&()); }; } // namespace application_manager_test diff --git a/src/components/include/test/application_manager/mock_state_controller.h b/src/components/include/test/application_manager/mock_state_controller.h index 6c4aaf9f19..9f8d94599b 100644 --- a/src/components/include/test/application_manager/mock_state_controller.h +++ b/src/components/include/test/application_manager/mock_state_controller.h @@ -48,36 +48,51 @@ namespace am = application_manager; class MockStateController : public am::StateController { public: MOCK_METHOD3(SetRegularState, - void(am::ApplicationSharedPtr app, am::HmiStatePtr state, const bool SendActivateApp)); + void(am::ApplicationSharedPtr app, + am::HmiStatePtr state, + const bool SendActivateApp)); MOCK_METHOD4(SetRegularState, - void(am::ApplicationSharedPtr app, const mobile_apis::HMILevel::eType hmi_level, const mobile_apis::AudioStreamingState::eType audio_state, const bool SendActivateApp)); + void(am::ApplicationSharedPtr app, + const mobile_apis::HMILevel::eType hmi_level, + const mobile_apis::AudioStreamingState::eType audio_state, + const bool SendActivateApp)); MOCK_METHOD3(SetRegularState, - void(am::ApplicationSharedPtr app, const mobile_apis::HMILevel::eType hmi_level, const bool SendActivateApp)); + void(am::ApplicationSharedPtr app, + const mobile_apis::HMILevel::eType hmi_level, + const bool SendActivateApp)); MOCK_METHOD5(SetRegularState, - void(am::ApplicationSharedPtr app, const mobile_apis::HMILevel::eType hmi_level, const mobile_apis::AudioStreamingState::eType audio_state, const mobile_apis::SystemContext::eType system_context, const bool SendActivateApp)); + void(am::ApplicationSharedPtr app, + const mobile_apis::HMILevel::eType hmi_level, + const mobile_apis::AudioStreamingState::eType audio_state, + const mobile_apis::SystemContext::eType system_context, + const bool SendActivateApp)); MOCK_METHOD2(SetRegularState, - void(am::ApplicationSharedPtr app, const mobile_apis::HMILevel::eType hmi_level)); + void(am::ApplicationSharedPtr app, + const mobile_apis::HMILevel::eType hmi_level)); MOCK_METHOD2(SetRegularState, - void(am::ApplicationSharedPtr app, const mobile_apis::AudioStreamingState::eType audio_state)); + void(am::ApplicationSharedPtr app, + const mobile_apis::AudioStreamingState::eType audio_state)); MOCK_METHOD2(SetRegularState, - void(am::ApplicationSharedPtr app, const mobile_apis::SystemContext::eType system_context)); + void(am::ApplicationSharedPtr app, + const mobile_apis::SystemContext::eType system_context)); MOCK_METHOD2(SetRegularState, - void(am::ApplicationSharedPtr app, am::HmiStatePtr state)); + void(am::ApplicationSharedPtr app, am::HmiStatePtr state)); MOCK_METHOD2(OnApplicationRegistered, - void(am::ApplicationSharedPtr app, const mobile_apis::HMILevel::eType default_level)); + void(am::ApplicationSharedPtr app, + const mobile_apis::HMILevel::eType default_level)); MOCK_METHOD3(SendBCActivateApp, - int64_t(am::ApplicationConstSharedPtr app, hmi_apis::Common_HMILevel::eType level, bool send_policy_priority)); - MOCK_METHOD0(OnNaviStreamingStarted, - void()); - MOCK_METHOD0(OnNaviStreamingStopped, - void()); + int64_t(am::ApplicationConstSharedPtr app, + hmi_apis::Common_HMILevel::eType level, + bool send_policy_priority)); + MOCK_METHOD0(OnNaviStreamingStarted, void()); + MOCK_METHOD0(OnNaviStreamingStopped, void()); MOCK_METHOD3(OnStateChanged, - void(am::ApplicationSharedPtr app, am::HmiStatePtr old_state, am::HmiStatePtr new_state)); - MOCK_CONST_METHOD1(IsStateActive, - bool(am::HmiState::StateID state_id)); + void(am::ApplicationSharedPtr app, + am::HmiStatePtr old_state, + am::HmiStatePtr new_state)); + MOCK_CONST_METHOD1(IsStateActive, bool(am::HmiState::StateID state_id)); }; - } // namespace application_manager_test } // namespace components } // namespace test diff --git a/src/components/include/test/application_manager/policies/mock_policy_handler_observer.h b/src/components/include/test/application_manager/policies/mock_policy_handler_observer.h index 899ec0777a..cc0f73126b 100644 --- a/src/components/include/test/application_manager/policies/mock_policy_handler_observer.h +++ b/src/components/include/test/application_manager/policies/mock_policy_handler_observer.h @@ -44,15 +44,14 @@ namespace test { namespace components { namespace application_manager_test { -class MockPolicyHandlerObserver : public ::policy::PolicyHandlerObserver { - public: - MOCK_METHOD1(OnUpdateHMIAppType, - void(std::map<std::string, std::vector<std::string> >)); - MOCK_METHOD1(OnCertificateUpdated, - bool(const std::string&)); +class MockPolicyHandlerObserver : public ::policy::PolicyHandlerObserver { + public: + MOCK_METHOD1(OnUpdateHMIAppType, + void(std::map<std::string, std::vector<std::string> >)); + MOCK_METHOD1(OnCertificateUpdated, bool(const std::string&)); }; -} // namespace application_manager_test -} // namespace components -} // namespace test +} // namespace application_manager_test +} // namespace components +} // namespace test #endif // SRC_COMPONENTS_INCLUDE_TEST_APPLICATION_MANAGER_POLICIES_MOCK_POLICY_HANDLER_OBSERVER_H_ diff --git a/src/components/include/test/transport_manager/mock_transport_manager_mme_settings.h b/src/components/include/test/transport_manager/mock_transport_manager_mme_settings.h index bb6fa6dd61..9e868977d3 100644 --- a/src/components/include/test/transport_manager/mock_transport_manager_mme_settings.h +++ b/src/components/include/test/transport_manager/mock_transport_manager_mme_settings.h @@ -53,7 +53,6 @@ class MockTransportManagerMMESettings MOCK_CONST_METHOD0(iap_system_config, const std::string&()); MOCK_CONST_METHOD0(iap2_system_config, const std::string&()); MOCK_CONST_METHOD0(iap_hub_connection_wait_timeout, uint32_t()); - }; } // namespace transport_manager_test diff --git a/src/components/include/test/transport_manager/mock_transport_manager_settings.h b/src/components/include/test/transport_manager/mock_transport_manager_settings.h index feba0c4fbe..a879723475 100644 --- a/src/components/include/test/transport_manager/mock_transport_manager_settings.h +++ b/src/components/include/test/transport_manager/mock_transport_manager_settings.h @@ -42,13 +42,12 @@ namespace components { namespace transport_manager_test { class MockTransportManagerSettings - : public ::transport_manager::TransportManagerSettings{ + : public ::transport_manager::TransportManagerSettings { public: MOCK_CONST_METHOD0(use_last_state, bool()); MOCK_CONST_METHOD0(transport_manager_disconnect_timeout, uint32_t()); MOCK_CONST_METHOD0(transport_manager_tcp_adapter_port, uint16_t()); - // from mme settings MOCK_CONST_METHOD0(event_mq_name, const std::string&()); MOCK_CONST_METHOD0(ack_mq_name, const std::string&()); diff --git a/src/components/include/utils/make_shared.h b/src/components/include/utils/make_shared.h index 665344737c..9d40d646a6 100644 --- a/src/components/include/utils/make_shared.h +++ b/src/components/include/utils/make_shared.h @@ -48,99 +48,144 @@ * SharedPtr<A> shared2(MakeShared<A>(5, 5.5); * SharedPtr<A> shared3(MakeShared<A>(5, 5.5, std::string("MyStr")); * - * The profit in using MakeShared instead of simple allocation with operator new is evident. - * Firstly it allows us to centralize allocation place, secondly it allows us to use + * The profit in using MakeShared instead of simple allocation with operator new + *is evident. + * Firstly it allows us to centralize allocation place, secondly it allows us to + *use * safe operator new overloading (no throwable one). */ namespace utils { -template <typename T> class SharedPtr; +template <typename T> +class SharedPtr; namespace { template <typename T> - SharedPtr<T>Initialize(T* object) { - return object == NULL ? SharedPtr<T>() : SharedPtr<T>(object); - } +SharedPtr<T> Initialize(T* object) { + return object == NULL ? SharedPtr<T>() : SharedPtr<T>(object); +} } -template<typename T> +template <typename T> SharedPtr<T> MakeShared() { T* t = new (std::nothrow) T; return Initialize(t); } -template<typename T, typename Arg1> +template <typename T, typename Arg1> SharedPtr<T> MakeShared(Arg1& arg1) { - T* t = new (std::nothrow) T(arg1); - return Initialize(t); + T* t = new (std::nothrow) T(arg1); + return Initialize(t); } -template<typename T, typename Arg1, typename Arg2> +template <typename T, typename Arg1, typename Arg2> SharedPtr<T> MakeShared(Arg1& arg1, Arg2& arg2) { - T* t = new (std::nothrow) T(arg1, arg2); - return Initialize(t); + T* t = new (std::nothrow) T(arg1, arg2); + return Initialize(t); } -template<typename T, typename Arg1, typename Arg2, typename Arg3> +template <typename T, typename Arg1, typename Arg2, typename Arg3> SharedPtr<T> MakeShared(Arg1& arg1, Arg2& arg2, Arg3& arg3) { - T* t = new (std::nothrow) T(arg1, arg2, arg3); - return Initialize(t); + T* t = new (std::nothrow) T(arg1, arg2, arg3); + return Initialize(t); } -template<typename T, typename Arg1, typename Arg2, typename Arg3, typename Arg4> +template <typename T, + typename Arg1, + typename Arg2, + typename Arg3, + typename Arg4> SharedPtr<T> MakeShared(Arg1& arg1, Arg2& arg2, Arg3& arg3, Arg4& arg4) { - T* t = new (std::nothrow) T(arg1, arg2, arg3, arg4); - return Initialize(t); + T* t = new (std::nothrow) T(arg1, arg2, arg3, arg4); + return Initialize(t); } -template<typename T, typename Arg1, typename Arg2, typename Arg3, typename Arg4, typename Arg5> -SharedPtr<T> MakeShared(Arg1& arg1, Arg2& arg2, Arg3& arg3, Arg4& arg4, Arg5& arg5) { - T* t = new (std::nothrow) T(arg1, arg2, arg3, arg4, arg5); - return Initialize(t); +template <typename T, + typename Arg1, + typename Arg2, + typename Arg3, + typename Arg4, + typename Arg5> +SharedPtr<T> MakeShared( + Arg1& arg1, Arg2& arg2, Arg3& arg3, Arg4& arg4, Arg5& arg5) { + T* t = new (std::nothrow) T(arg1, arg2, arg3, arg4, arg5); + return Initialize(t); } -template<typename T, typename Arg1, typename Arg2, typename Arg3, typename Arg4, typename Arg5, typename Arg6> -SharedPtr<T> MakeShared(Arg1& arg1, Arg2& arg2, Arg3& arg3, Arg4& arg4, Arg5& arg5, Arg6& arg6) { - T* t = new (std::nothrow) T(arg1, arg2, arg3, arg4, arg5, arg6); - return Initialize(t); +template <typename T, + typename Arg1, + typename Arg2, + typename Arg3, + typename Arg4, + typename Arg5, + typename Arg6> +SharedPtr<T> MakeShared( + Arg1& arg1, Arg2& arg2, Arg3& arg3, Arg4& arg4, Arg5& arg5, Arg6& arg6) { + T* t = new (std::nothrow) T(arg1, arg2, arg3, arg4, arg5, arg6); + return Initialize(t); } - -template<typename T, typename Arg1> +template <typename T, typename Arg1> SharedPtr<T> MakeShared(const Arg1& arg1) { - T* t = new (std::nothrow) T(arg1); - return Initialize(t); + T* t = new (std::nothrow) T(arg1); + return Initialize(t); } -template<typename T, typename Arg1, typename Arg2> +template <typename T, typename Arg1, typename Arg2> SharedPtr<T> MakeShared(const Arg1& arg1, const Arg2& arg2) { - T* t = new (std::nothrow) T(arg1, arg2); - return Initialize(t); + T* t = new (std::nothrow) T(arg1, arg2); + return Initialize(t); } -template<typename T, typename Arg1, typename Arg2, typename Arg3> +template <typename T, typename Arg1, typename Arg2, typename Arg3> SharedPtr<T> MakeShared(const Arg1& arg1, const Arg2& arg2, const Arg3& arg3) { - T* t = new (std::nothrow) T(arg1, arg2, arg3); - return Initialize(t); + T* t = new (std::nothrow) T(arg1, arg2, arg3); + return Initialize(t); } -template<typename T, typename Arg1, typename Arg2, typename Arg3, typename Arg4> -SharedPtr<T> MakeShared(const Arg1& arg1, const Arg2& arg2, const Arg3& arg3, const Arg4& arg4) { - T* t = new (std::nothrow) T(arg1, arg2, arg3, arg4); - return Initialize(t); +template <typename T, + typename Arg1, + typename Arg2, + typename Arg3, + typename Arg4> +SharedPtr<T> MakeShared(const Arg1& arg1, + const Arg2& arg2, + const Arg3& arg3, + const Arg4& arg4) { + T* t = new (std::nothrow) T(arg1, arg2, arg3, arg4); + return Initialize(t); } -template<typename T, typename Arg1, typename Arg2, typename Arg3, typename Arg4, typename Arg5> -SharedPtr<T> MakeShared(const Arg1& arg1, const Arg2& arg2, const Arg3& arg3, const Arg4& arg4, const Arg5& arg5) { - T* t = new (std::nothrow) T(arg1, arg2, arg3, arg4, arg5); - return Initialize(t); +template <typename T, + typename Arg1, + typename Arg2, + typename Arg3, + typename Arg4, + typename Arg5> +SharedPtr<T> MakeShared(const Arg1& arg1, + const Arg2& arg2, + const Arg3& arg3, + const Arg4& arg4, + const Arg5& arg5) { + T* t = new (std::nothrow) T(arg1, arg2, arg3, arg4, arg5); + return Initialize(t); } -template<typename T, typename Arg1, typename Arg2, typename Arg3, typename Arg4, typename Arg5, typename Arg6> -SharedPtr<T> MakeShared(const Arg1& arg1, const Arg2& arg2, const Arg3& arg3, const Arg4& arg4, const Arg5& arg5, const Arg6& arg6) { - T* t = new (std::nothrow) T(arg1, arg2, arg3, arg4, arg5, arg6); - return Initialize(t); +template <typename T, + typename Arg1, + typename Arg2, + typename Arg3, + typename Arg4, + typename Arg5, + typename Arg6> +SharedPtr<T> MakeShared(const Arg1& arg1, + const Arg2& arg2, + const Arg3& arg3, + const Arg4& arg4, + const Arg5& arg5, + const Arg6& arg6) { + T* t = new (std::nothrow) T(arg1, arg2, arg3, arg4, arg5, arg6); + return Initialize(t); } - -} // namespace utils; -#endif // SRC_COMPONENTS_INCLUDE_UTILS_MAKE_SHARED_H_ +} // namespace utils; +#endif // SRC_COMPONENTS_INCLUDE_UTILS_MAKE_SHARED_H_ diff --git a/src/components/include/utils/shared_ptr.h b/src/components/include/utils/shared_ptr.h index 11464488e1..064bb36b4a 100644 --- a/src/components/include/utils/shared_ptr.h +++ b/src/components/include/utils/shared_ptr.h @@ -42,8 +42,6 @@ namespace utils { - - /** * @brief Shared pointer. * @@ -53,238 +51,228 @@ namespace utils { * * @tparam ObjectType Type of wrapped object. **/ -template<typename ObjectType> +template <typename ObjectType> class SharedPtr { - static void DummyDeleter(ObjectType* object_to_delete) { - delete object_to_delete; - } - public: - //std smart pointer compatibility - typedef ObjectType element_type; - typedef void (*Deleter)(ObjectType*) ; - /** - * @brief Constructor. - * - * Initialize shared pointer with wrapped object. - * Reference counter will be initialized to 1. - * - * @param Object Wrapped object. - **/ - SharedPtr(ObjectType* Object); - - SharedPtr(ObjectType* Object, Deleter deleter): - mObject(Object), - mReferenceCounter(new uint32_t(1)), - deleter_(deleter) { - - } + static void DummyDeleter(ObjectType* object_to_delete) { + delete object_to_delete; + } - SharedPtr(); - - /** - * @brief Copy constructor. - * - * Initialize shared pointer with another shared pointer. - * Reference counter will be incremented. - * - * @param Other Other shared pointer. - **/ - SharedPtr(const SharedPtr<ObjectType>& Other); - - /** - * @brief Copy constructor. - * - * Initialize shared pointer with another shared pointer. - * Reference counter will be incremented. - * - * @tparam OtherObjectType Type of other object pointer. This - * allows creating a shared pointer to an - * intstance of a base class from a shared - * pointer to an instance of a class - * inherited from this base class. - * If OtherObjectType is not implicitly - * convertible to ObjectType it will - * cause a compile error. - * - * @param Other Other shared pointer. - **/ - template<typename OtherObjectType> - SharedPtr(const SharedPtr<OtherObjectType>& Other); - - /** - * @brief Destructor. - * - * Decrement reference counter and destroy wrapped object - * if reference counter reaches zero. - **/ - ~SharedPtr(); - - /** - * @brief Assignment operator. - * - * Drop reference to currently referenced object and add - * reference to assigned object. - * - * @param Other Shared pointer to an object - * that must be referenced. - * - * @return Reference to this shared pointer. - **/ - SharedPtr<ObjectType>& operator =(const SharedPtr<ObjectType>& Other); - - bool operator ==(const SharedPtr<ObjectType>& Other) const; - - bool operator <(const SharedPtr<ObjectType>& other) const; - - /** - * @brief Assignment operator. - * - * Drop reference to currently referenced object and add - * reference to assigned object. - * - * @tparam OtherObjectType Type of other object pointer. This - * allows creating a shared pointer to an - * intstance of a base class from a shared - * pointer to an instance of a class - * inherited from this base class. - * If OtherObjectType is not implicitly - * convertible to ObjectType it will - * cause a compile error. - * - * @param Other Shared pointer to an object - * that must be referenced. - * - * @return Reference to this shared pointer. - **/ - template<typename OtherObjectType> - SharedPtr<ObjectType>& operator =(const SharedPtr<OtherObjectType>& Other); - - template<typename OtherObjectType> - static SharedPtr<OtherObjectType> static_pointer_cast( + public: + // std smart pointer compatibility + typedef ObjectType element_type; + typedef void (*Deleter)(ObjectType*); + /** + * @brief Constructor. + * + * Initialize shared pointer with wrapped object. + * Reference counter will be initialized to 1. + * + * @param Object Wrapped object. + **/ + SharedPtr(ObjectType* Object); + + SharedPtr(ObjectType* Object, Deleter deleter) + : mObject(Object) + , mReferenceCounter(new uint32_t(1)) + , deleter_(deleter) {} + + SharedPtr(); + + /** + * @brief Copy constructor. + * + * Initialize shared pointer with another shared pointer. + * Reference counter will be incremented. + * + * @param Other Other shared pointer. + **/ + SharedPtr(const SharedPtr<ObjectType>& Other); + + /** + * @brief Copy constructor. + * + * Initialize shared pointer with another shared pointer. + * Reference counter will be incremented. + * + * @tparam OtherObjectType Type of other object pointer. This + * allows creating a shared pointer to an + * intstance of a base class from a shared + * pointer to an instance of a class + * inherited from this base class. + * If OtherObjectType is not implicitly + * convertible to ObjectType it will + * cause a compile error. + * + * @param Other Other shared pointer. + **/ + template <typename OtherObjectType> + SharedPtr(const SharedPtr<OtherObjectType>& Other); + + /** + * @brief Destructor. + * + * Decrement reference counter and destroy wrapped object + * if reference counter reaches zero. + **/ + ~SharedPtr(); + + /** + * @brief Assignment operator. + * + * Drop reference to currently referenced object and add + * reference to assigned object. + * + * @param Other Shared pointer to an object + * that must be referenced. + * + * @return Reference to this shared pointer. + **/ + SharedPtr<ObjectType>& operator=(const SharedPtr<ObjectType>& Other); + + bool operator==(const SharedPtr<ObjectType>& Other) const; + + bool operator<(const SharedPtr<ObjectType>& other) const; + + /** + * @brief Assignment operator. + * + * Drop reference to currently referenced object and add + * reference to assigned object. + * + * @tparam OtherObjectType Type of other object pointer. This + * allows creating a shared pointer to an + * intstance of a base class from a shared + * pointer to an instance of a class + * inherited from this base class. + * If OtherObjectType is not implicitly + * convertible to ObjectType it will + * cause a compile error. + * + * @param Other Shared pointer to an object + * that must be referenced. + * + * @return Reference to this shared pointer. + **/ + template <typename OtherObjectType> + SharedPtr<ObjectType>& operator=(const SharedPtr<OtherObjectType>& Other); + + template <typename OtherObjectType> + static SharedPtr<OtherObjectType> static_pointer_cast( const SharedPtr<ObjectType>& pointer); - template<typename OtherObjectType> - static SharedPtr<OtherObjectType> dynamic_pointer_cast( + template <typename OtherObjectType> + static SharedPtr<OtherObjectType> dynamic_pointer_cast( const SharedPtr<ObjectType>& pointer); - /** - * @brief Member access operator. - * - * @return Wrapped object. - **/ - ObjectType* operator->() const; + /** + * @brief Member access operator. + * + * @return Wrapped object. + **/ + ObjectType* operator->() const; - ObjectType& operator*() const; - operator bool() const; - void reset(); - void reset(ObjectType* other); - ObjectType* get() const; + ObjectType& operator*() const; + operator bool() const; + void reset(); + void reset(ObjectType* other); + ObjectType* get() const; #ifdef BUILD_TESTS - inline const uint32_t* get_ReferenceCounter() const { - return mReferenceCounter; - } -#endif // BUILD_TESTS - - /** - * @return true if mObject not NULL - */ - bool valid() const; - - private: - void reset_impl(ObjectType* other); - - // TSharedPtr needs access to other TSharedPtr private members - // for shared pointers type casts. - template<typename OtherObjectType> - friend class SharedPtr; - - /** - * @brief Drop reference to wrapped object. - * - * If reference counter reaches zero object and its reference - * counter will be deallocated. - **/ - void dropReference(); - - /** - * @brief Wrapped object. - **/ - ObjectType* mObject; - - - /** - * @brief Pointer to reference counter. - **/ - uint32_t* mReferenceCounter; - - Deleter deleter_; - void release(); + inline const uint32_t* get_ReferenceCounter() const { + return mReferenceCounter; + } +#endif // BUILD_TESTS + + /** + * @return true if mObject not NULL + */ + bool valid() const; + + private: + void reset_impl(ObjectType* other); + + // TSharedPtr needs access to other TSharedPtr private members + // for shared pointers type casts. + template <typename OtherObjectType> + friend class SharedPtr; + + /** + * @brief Drop reference to wrapped object. + * + * If reference counter reaches zero object and its reference + * counter will be deallocated. + **/ + void dropReference(); + + /** + * @brief Wrapped object. + **/ + ObjectType* mObject; + + /** + * @brief Pointer to reference counter. + **/ + uint32_t* mReferenceCounter; + + Deleter deleter_; + void release(); }; -template<typename ObjectType> +template <typename ObjectType> inline utils::SharedPtr<ObjectType>::SharedPtr(ObjectType* Object) - : mObject(NULL), - mReferenceCounter(new uint32_t(1)), - deleter_(DummyDeleter) { + : mObject(NULL) + , mReferenceCounter(new uint32_t(1)) + , deleter_(DummyDeleter) { DCHECK(Object != NULL); mObject = Object; } -template<typename ObjectType> +template <typename ObjectType> inline utils::SharedPtr<ObjectType>::SharedPtr() - : mObject(0), - mReferenceCounter(0), - deleter_(DummyDeleter) { -} + : mObject(0), mReferenceCounter(0), deleter_(DummyDeleter) {} -template<typename ObjectType> +template <typename ObjectType> inline utils::SharedPtr<ObjectType>::SharedPtr( - const SharedPtr<ObjectType>& Other) - : mObject(0), - mReferenceCounter(0), - deleter_(DummyDeleter) { + const SharedPtr<ObjectType>& Other) + : mObject(0), mReferenceCounter(0), deleter_(DummyDeleter) { *this = Other; } -template<typename ObjectType> -template<typename OtherObjectType> +template <typename ObjectType> +template <typename OtherObjectType> inline utils::SharedPtr<ObjectType>::SharedPtr( - const SharedPtr<OtherObjectType>& Other) - : mObject(0), - mReferenceCounter(0), - deleter_(DummyDeleter) { + const SharedPtr<OtherObjectType>& Other) + : mObject(0), mReferenceCounter(0), deleter_(DummyDeleter) { *this = Other; } -template<typename ObjectType> +template <typename ObjectType> inline utils::SharedPtr<ObjectType>::~SharedPtr() { dropReference(); } -template<typename ObjectType> -inline utils::SharedPtr<ObjectType>& -utils::SharedPtr<ObjectType>::operator=(const SharedPtr<ObjectType>& Other) { +template <typename ObjectType> +inline utils::SharedPtr<ObjectType>& utils::SharedPtr<ObjectType>::operator=( + const SharedPtr<ObjectType>& Other) { return operator=<ObjectType>(Other); } -template<typename ObjectType> -inline bool utils::SharedPtr<ObjectType>::operator ==( - const SharedPtr<ObjectType>& Other) const { +template <typename ObjectType> +inline bool utils::SharedPtr<ObjectType>::operator==( + const SharedPtr<ObjectType>& Other) const { return (mObject == Other.mObject); } -template<typename ObjectType> -inline bool utils::SharedPtr<ObjectType>::operator <( - const SharedPtr<ObjectType>& other) const { +template <typename ObjectType> +inline bool utils::SharedPtr<ObjectType>::operator<( + const SharedPtr<ObjectType>& other) const { return (mObject < other.mObject); } -template<typename ObjectType> -template<typename OtherObjectType> -inline utils::SharedPtr<ObjectType>& -utils::SharedPtr<ObjectType>::operator=( - const SharedPtr<OtherObjectType>& Other) { +template <typename ObjectType> +template <typename OtherObjectType> +inline utils::SharedPtr<ObjectType>& utils::SharedPtr<ObjectType>::operator=( + const SharedPtr<OtherObjectType>& Other) { dropReference(); mObject = Other.mObject; @@ -297,9 +285,10 @@ utils::SharedPtr<ObjectType>::operator=( return *this; } -template<typename ObjectType> -template<typename OtherObjectType> -utils::SharedPtr<OtherObjectType> utils::SharedPtr<ObjectType>::static_pointer_cast(const SharedPtr<ObjectType>& pointer) { +template <typename ObjectType> +template <typename OtherObjectType> +utils::SharedPtr<OtherObjectType> utils::SharedPtr< + ObjectType>::static_pointer_cast(const SharedPtr<ObjectType>& pointer) { SharedPtr<OtherObjectType> casted_pointer; casted_pointer.mObject = static_cast<OtherObjectType*>(pointer.mObject); casted_pointer.mReferenceCounter = pointer.mReferenceCounter; @@ -311,9 +300,10 @@ utils::SharedPtr<OtherObjectType> utils::SharedPtr<ObjectType>::static_pointer_c return casted_pointer; } -template<typename ObjectType> -template<typename OtherObjectType> -utils::SharedPtr<OtherObjectType> utils::SharedPtr<ObjectType>::dynamic_pointer_cast(const SharedPtr<ObjectType>& pointer) { +template <typename ObjectType> +template <typename OtherObjectType> +utils::SharedPtr<OtherObjectType> utils::SharedPtr< + ObjectType>::dynamic_pointer_cast(const SharedPtr<ObjectType>& pointer) { SharedPtr<OtherObjectType> casted_pointer; casted_pointer.mObject = dynamic_cast<OtherObjectType*>(pointer.mObject); if (NULL != casted_pointer.mObject) { @@ -327,35 +317,35 @@ utils::SharedPtr<OtherObjectType> utils::SharedPtr<ObjectType>::dynamic_pointer_ return casted_pointer; } -template<typename ObjectType> ObjectType* -utils::SharedPtr<ObjectType>::operator->() const { +template <typename ObjectType> +ObjectType* utils::SharedPtr<ObjectType>::operator->() const { DCHECK(mObject); return mObject; } -template<typename ObjectType> ObjectType& -utils::SharedPtr<ObjectType>::operator*() const { +template <typename ObjectType> +ObjectType& utils::SharedPtr<ObjectType>::operator*() const { DCHECK(mObject); return *mObject; } -template<typename ObjectType> +template <typename ObjectType> utils::SharedPtr<ObjectType>::operator bool() const { return valid(); } -template<typename ObjectType> void -utils::SharedPtr<ObjectType>::reset() { +template <typename ObjectType> +void utils::SharedPtr<ObjectType>::reset() { reset_impl(0); } -template<typename ObjectType> void -utils::SharedPtr<ObjectType>::reset(ObjectType* other) { +template <typename ObjectType> +void utils::SharedPtr<ObjectType>::reset(ObjectType* other) { DCHECK(other != NULL); reset_impl(other); } -template<typename ObjectType> +template <typename ObjectType> void SharedPtr<ObjectType>::release() { deleter_(mObject); mObject = 0; @@ -364,14 +354,14 @@ void SharedPtr<ObjectType>::release() { mReferenceCounter = 0; } -template<typename ObjectType> void -utils::SharedPtr<ObjectType>::reset_impl(ObjectType* other) { +template <typename ObjectType> +void utils::SharedPtr<ObjectType>::reset_impl(ObjectType* other) { dropReference(); mObject = other; mReferenceCounter = new uint32_t(1); } -template<typename ObjectType> +template <typename ObjectType> inline void SharedPtr<ObjectType>::dropReference() { if (0 != mReferenceCounter) { if (1 == atomic_post_dec(mReferenceCounter)) { @@ -380,12 +370,12 @@ inline void SharedPtr<ObjectType>::dropReference() { } } -template<typename ObjectType> +template <typename ObjectType> ObjectType* SharedPtr<ObjectType>::get() const { return mObject; } -template<typename ObjectType> +template <typename ObjectType> inline bool SharedPtr<ObjectType>::valid() const { if (mReferenceCounter && (0 < *mReferenceCounter)) { return (mObject != NULL); diff --git a/src/components/media_manager/include/media_manager/media_manager_impl.h b/src/components/media_manager/include/media_manager/media_manager_impl.h index 78e43d3023..c84a5a884f 100644 --- a/src/components/media_manager/include/media_manager/media_manager_impl.h +++ b/src/components/media_manager/include/media_manager/media_manager_impl.h @@ -42,45 +42,44 @@ #include "media_manager/media_adapter_listener.h" namespace application_manager { - class ApplicationManager; +class ApplicationManager; } namespace connection_handler { - class ConnectionHandlerImpl; +class ConnectionHandlerImpl; } namespace media_manager { class MediaManagerImpl : public MediaManager, - public protocol_handler::ProtocolObserver { - public: - MediaManagerImpl( - application_manager::ApplicationManager& application_manager, - const MediaManagerSettings& settings); - virtual ~MediaManagerImpl(); - - virtual void PlayA2DPSource(int32_t application_key); - virtual void StopA2DPSource(int32_t application_key); - - virtual void StartMicrophoneRecording(int32_t application_key, - const std::string& outputFileName, - int32_t duration); - virtual void StopMicrophoneRecording(int32_t application_key); - - virtual void StartStreaming( - int32_t application_key, protocol_handler::ServiceType service_type); - virtual void StopStreaming( - int32_t application_key, protocol_handler::ServiceType service_type); - - virtual void SetProtocolHandler( + public protocol_handler::ProtocolObserver { + public: + MediaManagerImpl(application_manager::ApplicationManager& application_manager, + const MediaManagerSettings& settings); + virtual ~MediaManagerImpl(); + + virtual void PlayA2DPSource(int32_t application_key); + virtual void StopA2DPSource(int32_t application_key); + + virtual void StartMicrophoneRecording(int32_t application_key, + const std::string& outputFileName, + int32_t duration); + virtual void StopMicrophoneRecording(int32_t application_key); + + virtual void StartStreaming(int32_t application_key, + protocol_handler::ServiceType service_type); + virtual void StopStreaming(int32_t application_key, + protocol_handler::ServiceType service_type); + + virtual void SetProtocolHandler( protocol_handler::ProtocolHandler* protocol_handler); - virtual void OnMessageReceived( + virtual void OnMessageReceived( const ::protocol_handler::RawMessagePtr message); - virtual void OnMobileMessageSent( + virtual void OnMobileMessageSent( const ::protocol_handler::RawMessagePtr message); - virtual void FramesProcessed(int32_t application_key, int32_t frame_number); + virtual void FramesProcessed(int32_t application_key, int32_t frame_number); - virtual const MediaManagerSettings& settings() const OVERRIDE; + virtual const MediaManagerSettings& settings() const OVERRIDE; #ifdef BUILD_TESTS void set_mock_a2dp_player(MediaAdapter* media_adapter); @@ -100,11 +99,11 @@ class MediaManagerImpl : public MediaManager, protocol_handler::ProtocolHandler* protocol_handler_; MediaAdapter* a2dp_player_; - MediaAdapterImpl* from_mic_recorder_; - MediaListenerPtr from_mic_listener_; + MediaAdapterImpl* from_mic_recorder_; + MediaListenerPtr from_mic_listener_; - std::map<protocol_handler::ServiceType, MediaAdapterImplPtr> streamer_; - std::map<protocol_handler::ServiceType, MediaListenerPtr> streamer_listener_; + std::map<protocol_handler::ServiceType, MediaAdapterImplPtr> streamer_; + std::map<protocol_handler::ServiceType, MediaListenerPtr> streamer_listener_; application_manager::ApplicationManager& application_manager_; diff --git a/src/components/media_manager/src/audio/a2dp_source_player_adapter.cc b/src/components/media_manager/src/audio/a2dp_source_player_adapter.cc index 9a5907d4f2..e5cd41c8c3 100644 --- a/src/components/media_manager/src/audio/a2dp_source_player_adapter.cc +++ b/src/components/media_manager/src/audio/a2dp_source_player_adapter.cc @@ -49,34 +49,33 @@ const static size_t BUFSIZE = 32; class A2DPSourcePlayerAdapter::A2DPSourcePlayerThread : public threads::ThreadDelegate { - public: - explicit A2DPSourcePlayerThread(const std::string& device); + public: + explicit A2DPSourcePlayerThread(const std::string& device); - void threadMain(); + void threadMain(); - void exitThreadMain(); + void exitThreadMain(); - private: - // The Sample format to use - static const pa_sample_spec sSampleFormat_; + private: + // The Sample format to use + static const pa_sample_spec sSampleFormat_; - pa_simple* s_in, *s_out; - std::string device_; - bool should_be_stopped_; - sync_primitives::Lock should_be_stopped_lock_; + pa_simple* s_in, *s_out; + std::string device_; + bool should_be_stopped_; + sync_primitives::Lock should_be_stopped_lock_; - void freeStreams(); + void freeStreams(); - DISALLOW_COPY_AND_ASSIGN(A2DPSourcePlayerThread); + DISALLOW_COPY_AND_ASSIGN(A2DPSourcePlayerThread); }; -A2DPSourcePlayerAdapter::A2DPSourcePlayerAdapter(protocol_handler::SessionObserver &session_observer) - : session_observer_(session_observer) { -} +A2DPSourcePlayerAdapter::A2DPSourcePlayerAdapter( + protocol_handler::SessionObserver& session_observer) + : session_observer_(session_observer) {} A2DPSourcePlayerAdapter::~A2DPSourcePlayerAdapter() { - for (SourcesMap::iterator it = sources_.begin(); - sources_.end() != it; ++it) { + for (SourcesMap::iterator it = sources_.begin(); sources_.end() != it; ++it) { Pair pair = it->second; pair.first->join(); delete pair.second; @@ -86,24 +85,19 @@ A2DPSourcePlayerAdapter::~A2DPSourcePlayerAdapter() { } void A2DPSourcePlayerAdapter::StartActivity(int32_t application_key) { - LOG4CXX_INFO(logger_, "Starting a2dp playing music for " - << application_key << " application."); + LOG4CXX_INFO(logger_, + "Starting a2dp playing music for " << application_key + << " application."); if (application_key != current_application_) { current_application_ = application_key; - const protocol_handler::SessionObserver& session_observer = - ->connection_handler() - .get_session_observer(); + const protocol_handler::SessionObserver& + session_observer =->connection_handler().get_session_observer(); uint32_t device_id = 0; - session_observer_.GetDataOnSessionKey( - application_key, 0, NULL, &device_id); + session_observer_.GetDataOnSessionKey(application_key, 0, NULL, &device_id); std::string mac_adddress; - session_observer_.GetDataOnDeviceID( - device_id, - NULL, - NULL, - &mac_adddress); + session_observer_.GetDataOnDeviceID(device_id, NULL, NULL, &mac_adddress); // TODO(PK): Convert mac_adddress to the // following format : "bluez_source.XX_XX_XX_XX_XX_XX" if needed @@ -111,16 +105,17 @@ void A2DPSourcePlayerAdapter::StartActivity(int32_t application_key) { A2DPSourcePlayerThread* delegate = new A2DPSourcePlayerAdapter::A2DPSourcePlayerThread(mac_adddress); - threads::Thread* new_activity = threads::CreateThread( - mac_adddress.c_str(), delegate); + threads::Thread* new_activity = + threads::CreateThread(mac_adddress.c_str(), delegate); sources_[application_key] = Pair(new_activity, delegate); new_activity->start(); } } void A2DPSourcePlayerAdapter::StopActivity(int32_t application_key) { - LOG4CXX_INFO(logger_, "Stopping 2dp playing for " - << application_key << " application."); + LOG4CXX_INFO(logger_, + "Stopping 2dp playing for " << application_key + << " application."); if (application_key != current_application_) { return; } @@ -139,18 +134,15 @@ bool A2DPSourcePlayerAdapter::is_app_performing_activity( return (application_key == current_application_); } -const pa_sample_spec A2DPSourcePlayerAdapter::A2DPSourcePlayerThread:: -sSampleFormat_ = { - /*format*/ PA_SAMPLE_S16LE, - /*rate*/ 44100, - /*channels*/ 2 -}; +const pa_sample_spec + A2DPSourcePlayerAdapter::A2DPSourcePlayerThread::sSampleFormat_ = { + /*format*/ PA_SAMPLE_S16LE, + /*rate*/ 44100, + /*channels*/ 2}; A2DPSourcePlayerAdapter::A2DPSourcePlayerThread::A2DPSourcePlayerThread( - const std::string& device) - : threads::ThreadDelegate(), - device_(device) { -} + const std::string& device) + : threads::ThreadDelegate(), device_(device) {} void A2DPSourcePlayerAdapter::A2DPSourcePlayerThread::freeStreams() { LOG4CXX_INFO(logger_, "Free streams in A2DPSourcePlayerThread."); @@ -185,15 +177,29 @@ void A2DPSourcePlayerAdapter::A2DPSourcePlayerThread::threadMain() { LOG4CXX_DEBUG(logger_, "Creating streams"); /* Create a new playback stream */ - if (!(s_out = pa_simple_new(NULL, "AudioManager", PA_STREAM_PLAYBACK, NULL, - "playback", &sSampleFormat_, NULL, NULL, &error))) { + if (!(s_out = pa_simple_new(NULL, + "AudioManager", + PA_STREAM_PLAYBACK, + NULL, + "playback", + &sSampleFormat_, + NULL, + NULL, + &error))) { LOG4CXX_ERROR(logger_, "pa_simple_new() failed: " << pa_strerror(error)); freeStreams(); return; } - if (!(s_in = pa_simple_new(NULL, "AudioManager", PA_STREAM_RECORD, a2dpSource, - "record", &sSampleFormat_, NULL, NULL, &error))) { + if (!(s_in = pa_simple_new(NULL, + "AudioManager", + PA_STREAM_RECORD, + a2dpSource, + "record", + &sSampleFormat_, + NULL, + NULL, + &error))) { LOG4CXX_ERROR(logger_, "pa_simple_new() failed: " << pa_strerror(error)); freeStreams(); return; @@ -206,17 +212,17 @@ void A2DPSourcePlayerAdapter::A2DPSourcePlayerThread::threadMain() { pa_usec_t latency; - if ((latency = pa_simple_get_latency(s_in, &error)) == (pa_usec_t) - 1) { - LOG4CXX_ERROR(logger_, "pa_simple_get_latency() failed: " - << pa_strerror(error)); + if ((latency = pa_simple_get_latency(s_in, &error)) == (pa_usec_t)-1) { + LOG4CXX_ERROR(logger_, + "pa_simple_get_latency() failed: " << pa_strerror(error)); break; } // LOG4CXX_INFO(logger_, "In: " << static_cast<float>(latency)); - if ((latency = pa_simple_get_latency(s_out, &error)) == (pa_usec_t) - 1) { - LOG4CXX_ERROR(logger_, "pa_simple_get_latency() failed: " - << pa_strerror(error)); + if ((latency = pa_simple_get_latency(s_out, &error)) == (pa_usec_t)-1) { + LOG4CXX_ERROR(logger_, + "pa_simple_get_latency() failed: " << pa_strerror(error)); break; } @@ -229,8 +235,8 @@ void A2DPSourcePlayerAdapter::A2DPSourcePlayerThread::threadMain() { /* ... and play it */ if (pa_simple_write(s_out, buf, sizeof(buf), &error) < 0) { - LOG4CXX_ERROR(logger_, "pa_simple_write() failed: " - << pa_strerror(error)); + LOG4CXX_ERROR(logger_, + "pa_simple_write() failed: " << pa_strerror(error)); break; } diff --git a/src/components/media_manager/src/audio/audio_stream_sender_thread.cc b/src/components/media_manager/src/audio/audio_stream_sender_thread.cc index eb41a84a09..24b12cabad 100644 --- a/src/components/media_manager/src/audio/audio_stream_sender_thread.cc +++ b/src/components/media_manager/src/audio/audio_stream_sender_thread.cc @@ -30,13 +30,11 @@ // POSSIBILITY OF SUCH DAMAGE. // - #if defined(OS_POSIX) && defined(OS_LINUX) #include <pthread.h> // TODO(DK): Need to remove #include <unistd.h> #endif - #include <string> #include <string.h> #include "application_manager/application_manager.h" @@ -59,9 +57,10 @@ const uint32_t kMqueueMessageSize = 4095; CREATE_LOGGERPTR_GLOBAL(logger_, "MediaManager") -AudioStreamSenderThread::AudioStreamSenderThread(const std::string& fileName, +AudioStreamSenderThread::AudioStreamSenderThread( + const std::string& fileName, uint32_t session_key, - application_manager::ApplicationManager &app_mngr) + application_manager::ApplicationManager& app_mngr) : session_key_(session_key) , fileName_(fileName) , shouldBeStoped_(false) @@ -71,8 +70,7 @@ AudioStreamSenderThread::AudioStreamSenderThread(const std::string& fileName, LOG4CXX_AUTO_TRACE(logger_); } -AudioStreamSenderThread::~AudioStreamSenderThread() { -} +AudioStreamSenderThread::~AudioStreamSenderThread() {} void AudioStreamSenderThread::threadMain() { LOG4CXX_AUTO_TRACE(logger_); @@ -84,7 +82,6 @@ void AudioStreamSenderThread::threadMain() { shouldBeStoped_cv_.WaitFor(auto_lock, kAudioPassThruTimeout * 1000); sendAudioChunkToMobile(); } - } void AudioStreamSenderThread::sendAudioChunkToMobile() { diff --git a/src/components/media_manager/src/audio/from_mic_recorder_listener.cc b/src/components/media_manager/src/audio/from_mic_recorder_listener.cc index 88581fd180..a02ec17f90 100644 --- a/src/components/media_manager/src/audio/from_mic_recorder_listener.cc +++ b/src/components/media_manager/src/audio/from_mic_recorder_listener.cc @@ -40,7 +40,8 @@ namespace media_manager { CREATE_LOGGERPTR_GLOBAL(logger_, "MediaManager") FromMicRecorderListener::FromMicRecorderListener( - const std::string& file_name, application_manager::ApplicationManager& app_mngr) + const std::string& file_name, + application_manager::ApplicationManager& app_mngr) : reader_(NULL), file_name_(file_name), application_manager_(app_mngr) {} FromMicRecorderListener::~FromMicRecorderListener() { @@ -52,25 +53,22 @@ FromMicRecorderListener::~FromMicRecorderListener() { } } -void FromMicRecorderListener::OnDataReceived( - int32_t application_key, - const DataForListener& data) { -} +void FromMicRecorderListener::OnDataReceived(int32_t application_key, + const DataForListener& data) {} -void FromMicRecorderListener::OnErrorReceived( - int32_t application_key, - const DataForListener& data) { -} +void FromMicRecorderListener::OnErrorReceived(int32_t application_key, + const DataForListener& data) {} void FromMicRecorderListener::OnActivityStarted(int32_t application_key) { - LOG4CXX_INFO(logger_, "FromMicRecorderListener::OnActivityStarted " - << application_key); + LOG4CXX_INFO(logger_, + "FromMicRecorderListener::OnActivityStarted " + << application_key); if (application_key == current_application_) { return; } if (!reader_) { - AudioStreamSenderThread* thread_delegate = - new AudioStreamSenderThread(file_name_, application_key, application_manager_); + AudioStreamSenderThread* thread_delegate = new AudioStreamSenderThread( + file_name_, application_key, application_manager_); reader_ = threads::CreateThread("RecorderSender", thread_delegate); } if (reader_) { @@ -80,11 +78,12 @@ void FromMicRecorderListener::OnActivityStarted(int32_t application_key) { } void FromMicRecorderListener::OnActivityEnded(int32_t application_key) { - LOG4CXX_INFO(logger_, "FromMicRecorderListener::OnActivityEnded " - << application_key); + LOG4CXX_INFO(logger_, + "FromMicRecorderListener::OnActivityEnded " << application_key); if (application_key != current_application_) { - LOG4CXX_WARN(logger_, "Not performing activity on " << application_key - << " but on " << current_application_); + LOG4CXX_WARN(logger_, + "Not performing activity on " << application_key << " but on " + << current_application_); return; } if (reader_) { diff --git a/src/components/media_manager/src/media_manager_impl.cc b/src/components/media_manager/src/media_manager_impl.cc index 60cdb9739a..e531894b27 100644 --- a/src/components/media_manager/src/media_manager_impl.cc +++ b/src/components/media_manager/src/media_manager_impl.cc @@ -30,7 +30,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ - #include "media_manager/media_manager_impl.h" #include "media_manager/audio/from_mic_recorder_listener.h" #include "media_manager/streamer_listener.h" @@ -56,17 +55,16 @@ namespace media_manager { - CREATE_LOGGERPTR_GLOBAL(logger_, "MediaManager") MediaManagerImpl::MediaManagerImpl( application_manager::ApplicationManager& application_manager, const MediaManagerSettings& settings) - : settings_(settings), - protocol_handler_(NULL) - , a2dp_player_(NULL) - , from_mic_recorder_(NULL), - application_manager_(application_manager) { + : settings_(settings) + , protocol_handler_(NULL) + , a2dp_player_(NULL) + , from_mic_recorder_(NULL) + , application_manager_(application_manager) { Init(); } @@ -83,32 +81,32 @@ MediaManagerImpl::~MediaManagerImpl() { } #ifdef BUILD_TESTS - void MediaManagerImpl::set_mock_a2dp_player(MediaAdapter* media_adapter) { - a2dp_player_= media_adapter; - } +void MediaManagerImpl::set_mock_a2dp_player(MediaAdapter* media_adapter) { + a2dp_player_ = media_adapter; +} - void MediaManagerImpl::set_mock_mic_listener(MediaListenerPtr media_listener) { - from_mic_listener_ = media_listener; - } +void MediaManagerImpl::set_mock_mic_listener(MediaListenerPtr media_listener) { + from_mic_listener_ = media_listener; +} #ifdef EXTENDED_MEDIA_MODE - void MediaManagerImpl::set_mock_mic_recorder(MediaAdapterImpl* media_adapter) { - from_mic_recorder_ = media_adapter; - } +void MediaManagerImpl::set_mock_mic_recorder(MediaAdapterImpl* media_adapter) { + from_mic_recorder_ = media_adapter; +} -#endif // EXTENDED_MEDIA_MODE +#endif // EXTENDED_MEDIA_MODE - void MediaManagerImpl::set_mock_streamer(protocol_handler::ServiceType stype, - MediaAdapterImpl* mock_stream) { - streamer_[stype]= mock_stream; - } +void MediaManagerImpl::set_mock_streamer(protocol_handler::ServiceType stype, + MediaAdapterImpl* mock_stream) { + streamer_[stype] = mock_stream; +} - void MediaManagerImpl::set_mock_streamer_listener(protocol_handler::ServiceType stype, - MediaAdapterListener* mock_stream) { - streamer_listener_[stype]= mock_stream; - } +void MediaManagerImpl::set_mock_streamer_listener( + protocol_handler::ServiceType stype, MediaAdapterListener* mock_stream) { + streamer_listener_[stype] = mock_stream; +} -#endif // BUILD_TESTS +#endif // BUILD_TESTS void MediaManagerImpl::Init() { using namespace protocol_handler; @@ -116,7 +114,8 @@ void MediaManagerImpl::Init() { #if defined(EXTENDED_MEDIA_MODE) LOG4CXX_INFO(logger_, "Called Init with default configuration."); - a2dp_player_ = new A2DPSourcePlayerAdapter(protocol_handler_->get_session_observer()); + a2dp_player_ = + new A2DPSourcePlayerAdapter(protocol_handler_->get_session_observer()); from_mic_recorder_ = new FromMicRecorderAdapter(); #endif @@ -124,7 +123,7 @@ void MediaManagerImpl::Init() { streamer_[ServiceType::kMobileNav] = new SocketVideoStreamerAdapter( settings().server_address(), settings().video_streaming_port()); } else if ("pipe" == settings().video_server_type()) { - streamer_[ServiceType::kMobileNav]= new PipeVideoStreamerAdapter( + streamer_[ServiceType::kMobileNav] = new PipeVideoStreamerAdapter( settings().named_video_pipe_path(), settings().app_storage_folder()); } else if ("file" == settings().video_server_type()) { streamer_[ServiceType::kMobileNav] = new FileVideoStreamerAdapter( @@ -170,27 +169,25 @@ void MediaManagerImpl::StopA2DPSource(int32_t application_key) { } } -void MediaManagerImpl::StartMicrophoneRecording( - int32_t application_key, - const std::string& output_file, - int32_t duration) { - LOG4CXX_INFO(logger_, "MediaManagerImpl::StartMicrophoneRecording to " - << output_file); +void MediaManagerImpl::StartMicrophoneRecording(int32_t application_key, + const std::string& output_file, + int32_t duration) { + LOG4CXX_INFO(logger_, + "MediaManagerImpl::StartMicrophoneRecording to " << output_file); application_manager::ApplicationSharedPtr app = application_manager_.application(application_key); - std::string file_path = - settings().app_storage_folder(); + std::string file_path = settings().app_storage_folder(); file_path += "/"; file_path += output_file; - from_mic_listener_ = new FromMicRecorderListener(file_path, - application_manager_); + from_mic_listener_ = + new FromMicRecorderListener(file_path, application_manager_); #ifdef EXTENDED_MEDIA_MODE if (from_mic_recorder_) { from_mic_recorder_->AddListener(from_mic_listener_); (static_cast<FromMicRecorderAdapter*>(from_mic_recorder_)) - ->set_output_file(file_path); + ->set_output_file(file_path); (static_cast<FromMicRecorderAdapter*>(from_mic_recorder_)) - ->set_duration(duration); + ->set_duration(duration); from_mic_recorder_->StartActivity(application_key); } #else @@ -198,25 +195,23 @@ void MediaManagerImpl::StartMicrophoneRecording( LOG4CXX_INFO(logger_, "File " << output_file << " exists, removing"); if (file_system::DeleteFile(file_path)) { LOG4CXX_INFO(logger_, "File " << output_file << " removed"); - } - else { + } else { LOG4CXX_WARN(logger_, "Could not remove file " << output_file); } } - const std::string record_file_source = - settings().app_resource_folder() + "/" + - settings().recording_file_source(); + const std::string record_file_source = settings().app_resource_folder() + + "/" + + settings().recording_file_source(); std::vector<uint8_t> buf; if (file_system::ReadBinaryFile(record_file_source, buf)) { if (file_system::Write(file_path, buf)) { LOG4CXX_INFO(logger_, - "File " << record_file_source << " copied to " << output_file); - } - else { + "File " << record_file_source << " copied to " + << output_file); + } else { LOG4CXX_WARN(logger_, "Could not write to file " << output_file); } - } - else { + } else { LOG4CXX_WARN(logger_, "Could not read file " << record_file_source); } #endif @@ -259,7 +254,7 @@ void MediaManagerImpl::StopStreaming( } void MediaManagerImpl::SetProtocolHandler( - protocol_handler::ProtocolHandler* protocol_handler) { + protocol_handler::ProtocolHandler* protocol_handler) { protocol_handler_ = protocol_handler; } @@ -274,14 +269,15 @@ void MediaManagerImpl::OnMessageReceived( const ServiceType service_type = message->service_type(); if (Compare<ServiceType, NEQ, ALL>( - service_type, ServiceType::kMobileNav, ServiceType::kAudio)) { + service_type, ServiceType::kMobileNav, ServiceType::kAudio)) { LOG4CXX_DEBUG(logger_, "Unsupported service type in MediaManager"); return; } if (!application_manager_.CanAppStream(streaming_app_id, service_type)) { application_manager_.ForbidStreaming(streaming_app_id); - LOG4CXX_ERROR(logger_, "The application trying to stream when it should not."); + LOG4CXX_ERROR(logger_, + "The application trying to stream when it should not."); return; } @@ -293,14 +289,12 @@ void MediaManagerImpl::OnMessageReceived( } void MediaManagerImpl::OnMobileMessageSent( - const ::protocol_handler::RawMessagePtr message) { -} + const ::protocol_handler::RawMessagePtr message) {} void MediaManagerImpl::FramesProcessed(int32_t application_key, int32_t frame_number) { if (protocol_handler_) { - protocol_handler_->SendFramesNumber(application_key, - frame_number); + protocol_handler_->SendFramesNumber(application_key, frame_number); } } diff --git a/src/components/media_manager/test/media_manager_impl_test.cc b/src/components/media_manager/test/media_manager_impl_test.cc index d0bad86454..463025c6c8 100644 --- a/src/components/media_manager/test/media_manager_impl_test.cc +++ b/src/components/media_manager/test/media_manager_impl_test.cc @@ -61,23 +61,25 @@ class MediaManagerImplTest : public ::testing::Test { }; TEST_F(MediaManagerImplTest, PlayA2DPSource) { - MockMediaAdapter* media_mock_ = new MockMediaAdapter(); + MockMediaAdapter* media_mock_ = new MockMediaAdapter(); application_manager_test::MockApplicationManager mock_application_manager; - ON_CALL(mock_media_manager_settings_,video_server_type()).WillByDefault(ReturnRef(kDefaultValue_)); - ON_CALL(mock_media_manager_settings_,audio_server_type()).WillByDefault(ReturnRef(kDefaultValue_)); - MediaManagerImpl mediaManagerImpl(mock_application_manager, mock_media_manager_settings_); + ON_CALL(mock_media_manager_settings_, video_server_type()) + .WillByDefault(ReturnRef(kDefaultValue_)); + ON_CALL(mock_media_manager_settings_, audio_server_type()) + .WillByDefault(ReturnRef(kDefaultValue_)); + MediaManagerImpl mediaManagerImpl(mock_application_manager, + mock_media_manager_settings_); int32_t application_key = 1; - mediaManagerImpl.set_mock_a2dp_player(media_mock_); EXPECT_CALL(*media_mock_, StartActivity(application_key)); mediaManagerImpl.PlayA2DPSource(application_key); } TEST_F(MediaManagerImplTest, StopA2DPSource) { - MockMediaAdapter* media_mock_ = new MockMediaAdapter(); + MockMediaAdapter* media_mock_ = new MockMediaAdapter(); application_manager_test::MockApplicationManager mock_application_manager; ON_CALL(mock_media_manager_settings_, video_server_type()) @@ -88,75 +90,89 @@ TEST_F(MediaManagerImplTest, StopA2DPSource) { mock_media_manager_settings_); int32_t application_key = 1; - mediaManagerImpl.set_mock_a2dp_player(media_mock_); EXPECT_CALL(*media_mock_, StopActivity(application_key)); mediaManagerImpl.StopA2DPSource(application_key); } TEST_F(MediaManagerImplTest, StopMicrophoneRecording) { + MockMediaAdapterListener* media_adapter_listener_mock_ = + new MockMediaAdapterListener(); + application_manager_test::MockApplicationManager mock_application_manager; -MockMediaAdapterListener* media_adapter_listener_mock_ = new MockMediaAdapterListener(); - application_manager_test::MockApplicationManager mock_application_manager; - - ON_CALL(mock_media_manager_settings_,video_server_type()).WillByDefault(ReturnRef(kDefaultValue_)); - ON_CALL(mock_media_manager_settings_,audio_server_type()).WillByDefault(ReturnRef(kDefaultValue_)); - MediaManagerImpl mediaManagerImpl(mock_application_manager, mock_media_manager_settings_); + ON_CALL(mock_media_manager_settings_, video_server_type()) + .WillByDefault(ReturnRef(kDefaultValue_)); + ON_CALL(mock_media_manager_settings_, audio_server_type()) + .WillByDefault(ReturnRef(kDefaultValue_)); + MediaManagerImpl mediaManagerImpl(mock_application_manager, + mock_media_manager_settings_); int32_t application_key = 1; mediaManagerImpl.set_mock_mic_listener(media_adapter_listener_mock_); #ifdef EXTENDED_MEDIA_MODE - MockMediaAdapterImpl* media_adapter_recorder_mock = new MockMediaAdapterImpl(); + MockMediaAdapterImpl* media_adapter_recorder_mock = + new MockMediaAdapterImpl(); mediaManagerImpl.set_mock_mic_recorder(media_adapter_recorder_mock); - EXPECT_CALL(*media_adapter_recorder_mock,StopActivity(application_key)); -#endif // EXTENDED_MEDIA_MODE + EXPECT_CALL(*media_adapter_recorder_mock, StopActivity(application_key)); +#endif // EXTENDED_MEDIA_MODE EXPECT_CALL(*media_adapter_listener_mock_, OnActivityEnded(application_key)); #ifdef EXTENDED_MEDIA_MODE - EXPECT_CALL(*media_adapter_recorder_mock,RemoveListener(_)); -#endif // EXTENDED_MEDIA_MODE + EXPECT_CALL(*media_adapter_recorder_mock, RemoveListener(_)); +#endif // EXTENDED_MEDIA_MODE mediaManagerImpl.StopMicrophoneRecording(application_key); } TEST_F(MediaManagerImplTest, StartStopStreaming) { + application_manager_test::MockApplicationManager mock_application_manager; - - application_manager_test::MockApplicationManager mock_application_manager; - - ON_CALL(mock_media_manager_settings_,video_server_type()).WillByDefault(ReturnRef(kDefaultValue_)); - ON_CALL(mock_media_manager_settings_,audio_server_type()).WillByDefault(ReturnRef(kDefaultValue_)); - MediaManagerImpl mediaManagerImpl(mock_application_manager, mock_media_manager_settings_); + ON_CALL(mock_media_manager_settings_, video_server_type()) + .WillByDefault(ReturnRef(kDefaultValue_)); + ON_CALL(mock_media_manager_settings_, audio_server_type()) + .WillByDefault(ReturnRef(kDefaultValue_)); + MediaManagerImpl mediaManagerImpl(mock_application_manager, + mock_media_manager_settings_); int32_t application_key = 1; MockMediaAdapterImpl* mock_audio_media_streamer = new MockMediaAdapterImpl(); - mediaManagerImpl.set_mock_streamer(protocol_handler::ServiceType::kAudio, mock_audio_media_streamer); + mediaManagerImpl.set_mock_streamer(protocol_handler::ServiceType::kAudio, + mock_audio_media_streamer); MockMediaAdapterImpl* mock_nav_media_streamer = new MockMediaAdapterImpl(); - mediaManagerImpl.set_mock_streamer(protocol_handler::ServiceType::kMobileNav, mock_nav_media_streamer); + mediaManagerImpl.set_mock_streamer(protocol_handler::ServiceType::kMobileNav, + mock_nav_media_streamer); EXPECT_CALL(*mock_audio_media_streamer, StartActivity(application_key)); - mediaManagerImpl.StartStreaming(application_key, protocol_handler::ServiceType::kAudio); + mediaManagerImpl.StartStreaming(application_key, + protocol_handler::ServiceType::kAudio); EXPECT_CALL(*mock_nav_media_streamer, StartActivity(application_key)); - mediaManagerImpl.StartStreaming(application_key, protocol_handler::ServiceType::kMobileNav); + mediaManagerImpl.StartStreaming(application_key, + protocol_handler::ServiceType::kMobileNav); EXPECT_CALL(*mock_audio_media_streamer, StopActivity(application_key)); - mediaManagerImpl.StopStreaming(application_key, protocol_handler::ServiceType::kAudio); + mediaManagerImpl.StopStreaming(application_key, + protocol_handler::ServiceType::kAudio); EXPECT_CALL(*mock_nav_media_streamer, StopActivity(application_key)); - mediaManagerImpl.StopStreaming(application_key, protocol_handler::ServiceType::kMobileNav); + mediaManagerImpl.StopStreaming(application_key, + protocol_handler::ServiceType::kMobileNav); } TEST_F(MediaManagerImplTest, CheckFramesProcessed) { application_manager_test::MockApplicationManager mock_application_manager; - ON_CALL(mock_media_manager_settings_,video_server_type()).WillByDefault(ReturnRef(kDefaultValue_)); - ON_CALL(mock_media_manager_settings_,audio_server_type()).WillByDefault(ReturnRef(kDefaultValue_)); - MediaManagerImpl mediaManagerImpl(mock_application_manager, mock_media_manager_settings_); + ON_CALL(mock_media_manager_settings_, video_server_type()) + .WillByDefault(ReturnRef(kDefaultValue_)); + ON_CALL(mock_media_manager_settings_, audio_server_type()) + .WillByDefault(ReturnRef(kDefaultValue_)); + MediaManagerImpl mediaManagerImpl(mock_application_manager, + mock_media_manager_settings_); protocol_handler_test::MockProtocolHandler mock_protocol_handler; mediaManagerImpl.SetProtocolHandler(&mock_protocol_handler); int32_t application_key = 1; int32_t frame_number = 10; - EXPECT_CALL(mock_protocol_handler, SendFramesNumber(application_key, frame_number)); + EXPECT_CALL(mock_protocol_handler, + SendFramesNumber(application_key, frame_number)); mediaManagerImpl.FramesProcessed(application_key, frame_number); } diff --git a/src/components/policy/src/policy/include/policy/policy_manager.h b/src/components/policy/src/policy/include/policy/policy_manager.h index e406e4309d..70ec5d23a2 100644 --- a/src/components/policy/src/policy/include/policy/policy_manager.h +++ b/src/components/policy/src/policy/include/policy/policy_manager.h @@ -44,426 +44,433 @@ namespace policy { class PolicySettings; class PolicyManager : public usage_statistics::StatisticsManager { - public: - virtual ~PolicyManager() { - } - - virtual void set_listener(PolicyListener* listener) = 0; - - /** - * Inits Policy Table - * @param file_name Path to preloaded PT file - * @return true if successfully - */ - virtual bool InitPT(const std::string& file_name, const PolicySettings* settings) = 0; - - /** - * @brief Updates Policy Table from binary message received from - * mobile device. Saves to Policy Table diff between Policy Table - * sent in snapshot and received Policy Table. - * @param file name of file with update policy table - * @param pt_content PTU as binary string - * @return bool Success of operation - */ - virtual bool LoadPT(const std::string& file, const BinaryMessage& pt_content) = 0; - - /** - * Resets Policy Table - * @param file_name Path to preloaded PT file - * @return true if successfully - */ - virtual bool ResetPT(const std::string& file_name) = 0; - - /** - * @brief GetLockScreenIcon allows to obtain lock screen icon url; - * - * @return url which point to the resourse where lock screen icon could be obtained. - */ - virtual std::string GetLockScreenIconUrl() const = 0; - - /** - * @brief Gets all URLs for sending PTS to from PT itself. - * @param service_type Service specifies user of URL - * @return vector of urls - */ - virtual void GetServiceUrls(const std::string& service_type, - EndpointUrls& end_points) = 0; - - /** - * @brief PTU is needed, for this PTS has to be formed and sent. - */ - virtual bool RequestPTUpdate() = 0; - - /** - * @brief Check if specified RPC for specified application - * has permission to be executed in specified HMI Level - * and also its permitted params. - * @param app_id Id of application provided during registration - * @param hmi_level Current HMI Level of application - * @param rpc Name of RPC - * @param CheckPermissionResult containing flag if HMI Level is allowed - * and list of allowed params. - */ - virtual void CheckPermissions(const PTString& app_id, - const PTString& hmi_level, - const PTString& rpc, - const RPCParams& rpc_params, - CheckPermissionResult& result) = 0; - - /** - * @brief Clear all record of user consents. Used during Factory Reset. - * @return bool Success of operation - */ - virtual bool ResetUserConsent() = 0; - - /** - * @brief Returns current status of policy table for HMI - * @return Current status of policy table - */ - virtual std::string GetPolicyTableStatus() const = 0; - - /** - * Checks is PT exceeded kilometers - * @param kilometers current kilometers at odometer - * @return true if exceeded - */ - virtual void KmsChanged(int kilometers) = 0; - - /** - * Increments counter of ignition cycles - */ - virtual void IncrementIgnitionCycles() = 0; - - /** - * @brief ExchangeByUserRequest - */ - virtual std::string ForcePTExchange() = 0; - - /** - * Resets retry sequence - */ - virtual void ResetRetrySequence() = 0; - - /** - * Gets timeout to wait before next retry updating PT - * If timeout is equal to zero then the retry sequence is not need. - * @return timeout in seconds - */ - virtual uint32_t NextRetryTimeout() = 0; - - /** - * Gets timeout to wait until receive response - * @return timeout in seconds - */ - virtual int TimeoutExchange() = 0; - - /** - * @brief List of timeouts in seconds between retries - * when attempt to update PT fails - * @return List of delays between attempts. - */ - virtual const std::vector<int> RetrySequenceDelaysSeconds() = 0; - - /** - * Handler of exceeding timeout of exchanging policy table - */ - virtual void OnExceededTimeout() = 0; - - /** - * @brief Handler of PTS sending out - */ - virtual void OnUpdateStarted() = 0; - - /** - * @brief Check user consent for mobile device data connection - * @param device_id Unique device identifier - * @return status of device consent - */ - virtual DeviceConsent GetUserConsentForDevice( + public: + virtual ~PolicyManager() {} + + virtual void set_listener(PolicyListener* listener) = 0; + + /** + * Inits Policy Table + * @param file_name Path to preloaded PT file + * @return true if successfully + */ + virtual bool InitPT(const std::string& file_name, + const PolicySettings* settings) = 0; + + /** + * @brief Updates Policy Table from binary message received from + * mobile device. Saves to Policy Table diff between Policy Table + * sent in snapshot and received Policy Table. + * @param file name of file with update policy table + * @param pt_content PTU as binary string + * @return bool Success of operation + */ + virtual bool LoadPT(const std::string& file, + const BinaryMessage& pt_content) = 0; + + /** + * Resets Policy Table + * @param file_name Path to preloaded PT file + * @return true if successfully + */ + virtual bool ResetPT(const std::string& file_name) = 0; + + /** + * @brief GetLockScreenIcon allows to obtain lock screen icon url; + * + * @return url which point to the resourse where lock screen icon could be + *obtained. + */ + virtual std::string GetLockScreenIconUrl() const = 0; + + /** + * @brief Gets all URLs for sending PTS to from PT itself. + * @param service_type Service specifies user of URL + * @return vector of urls + */ + virtual void GetServiceUrls(const std::string& service_type, + EndpointUrls& end_points) = 0; + + /** + * @brief PTU is needed, for this PTS has to be formed and sent. + */ + virtual bool RequestPTUpdate() = 0; + + /** + * @brief Check if specified RPC for specified application + * has permission to be executed in specified HMI Level + * and also its permitted params. + * @param app_id Id of application provided during registration + * @param hmi_level Current HMI Level of application + * @param rpc Name of RPC + * @param CheckPermissionResult containing flag if HMI Level is allowed + * and list of allowed params. + */ + virtual void CheckPermissions(const PTString& app_id, + const PTString& hmi_level, + const PTString& rpc, + const RPCParams& rpc_params, + CheckPermissionResult& result) = 0; + + /** + * @brief Clear all record of user consents. Used during Factory Reset. + * @return bool Success of operation + */ + virtual bool ResetUserConsent() = 0; + + /** + * @brief Returns current status of policy table for HMI + * @return Current status of policy table + */ + virtual std::string GetPolicyTableStatus() const = 0; + + /** + * Checks is PT exceeded kilometers + * @param kilometers current kilometers at odometer + * @return true if exceeded + */ + virtual void KmsChanged(int kilometers) = 0; + + /** + * Increments counter of ignition cycles + */ + virtual void IncrementIgnitionCycles() = 0; + + /** + * @brief ExchangeByUserRequest + */ + virtual std::string ForcePTExchange() = 0; + + /** + * Resets retry sequence + */ + virtual void ResetRetrySequence() = 0; + + /** + * Gets timeout to wait before next retry updating PT + * If timeout is equal to zero then the retry sequence is not need. + * @return timeout in seconds + */ + virtual uint32_t NextRetryTimeout() = 0; + + /** + * Gets timeout to wait until receive response + * @return timeout in seconds + */ + virtual int TimeoutExchange() = 0; + + /** + * @brief List of timeouts in seconds between retries + * when attempt to update PT fails + * @return List of delays between attempts. + */ + virtual const std::vector<int> RetrySequenceDelaysSeconds() = 0; + + /** + * Handler of exceeding timeout of exchanging policy table + */ + virtual void OnExceededTimeout() = 0; + + /** + * @brief Handler of PTS sending out + */ + virtual void OnUpdateStarted() = 0; + + /** + * @brief Check user consent for mobile device data connection + * @param device_id Unique device identifier + * @return status of device consent + */ + virtual DeviceConsent GetUserConsentForDevice( const std::string& device_id) const = 0; - /** - * @brief Get user consent for application - * @param device_id Device id - * @param policy_app_id Unique application id - * @param permissions Array of functional groups permissions - */ - virtual void GetUserConsentForApp( - const std::string& device_id, const std::string& policy_app_id, + /** + * @brief Get user consent for application + * @param device_id Device id + * @param policy_app_id Unique application id + * @param permissions Array of functional groups permissions + */ + virtual void GetUserConsentForApp( + const std::string& device_id, + const std::string& policy_app_id, std::vector<FunctionalGroupPermission>& permissions) = 0; - /** - * @brief Set user consent for mobile device data connection - * @param device_id Unique device identifier - * @param is_allowed User consent for usage device data connection - */ - virtual void SetUserConsentForDevice(const std::string& device_id, - bool is_allowed) = 0; - - /** - * @brief Update Application Policies as reaction - * on User allowing/disallowing device this app is running on. - */ - virtual bool ReactOnUserDevConsentForApp(const std::string app_id, - bool is_device_allowed) = 0; - /** - * Sets counter value that passed for receiving PT UPdate. - */ - virtual void PTUpdatedAt(Counters counter, int value) = 0; - - /** - * @brief Retrieves data from app_policies about app on its registration: - * @param app_id - id of registered app - * @param app_types Section on HMI where app can appear (Navigation, Phone etc) - * @param nicknames Synonyms for application - */ - virtual bool GetInitialAppData(const std::string& application_id, - StringArray* nicknames = NULL, - StringArray* app_hmi_types = NULL) = 0; - - /** - * @brief Add's device to policy table - * @param device_id Device mac address - * @param connection_type Device connection type - */ - virtual void AddDevice(const std::string& device_id, - const std::string& connection_type) = 0; - - /** - * @brief Stores device parameters received during application registration - * to policy table - * @param device_id Device mac address - * @param device_info Received device parameters - */ - virtual void SetDeviceInfo(const std::string& device_id, - const DeviceInfo& device_info) = 0; - - /** - * @brief Set user consent for application functional groups - * @param permissions User-defined application group pemissions. - * The permissions is not const reference because it may contains - * valid data as well as invalid. So we will remove all invalid data - * from this structure. - */ - virtual void SetUserConsentForApp(const PermissionConsent& permissions) = 0; - - /** - * @brief Get default HMI level for application - * @param policy_app_id Unique application id - * @param default_hmi Default HMI level for application or empty, if value - * was not set - * @return true, if succedeed, otherwise - false - */ - virtual bool GetDefaultHmi(const std::string& policy_app_id, - std::string* default_hmi) const = 0; - - /** - * @brief Get priority for application - * @param policy_app_id Unique application id - * @param priority Priority for application or empty, if value was not set - * @return true, if succedeed, otherwise - false - */ - virtual bool GetPriority(const std::string& policy_app_id, - std::string* priority) const = 0; - - /** - * @brief Get user friendly messages for given RPC messages and language - * @param message_codes RPC message codes - * @param language Language - * @return Array of structs with appropriate message parameters - */ - virtual std::vector<UserFriendlyMessage> GetUserFriendlyMessages( + /** + * @brief Set user consent for mobile device data connection + * @param device_id Unique device identifier + * @param is_allowed User consent for usage device data connection + */ + virtual void SetUserConsentForDevice(const std::string& device_id, + bool is_allowed) = 0; + + /** + * @brief Update Application Policies as reaction + * on User allowing/disallowing device this app is running on. + */ + virtual bool ReactOnUserDevConsentForApp(const std::string app_id, + bool is_device_allowed) = 0; + /** + * Sets counter value that passed for receiving PT UPdate. + */ + virtual void PTUpdatedAt(Counters counter, int value) = 0; + + /** + * @brief Retrieves data from app_policies about app on its registration: + * @param app_id - id of registered app + * @param app_types Section on HMI where app can appear (Navigation, Phone + * etc) + * @param nicknames Synonyms for application + */ + virtual bool GetInitialAppData(const std::string& application_id, + StringArray* nicknames = NULL, + StringArray* app_hmi_types = NULL) = 0; + + /** + * @brief Add's device to policy table + * @param device_id Device mac address + * @param connection_type Device connection type + */ + virtual void AddDevice(const std::string& device_id, + const std::string& connection_type) = 0; + + /** + * @brief Stores device parameters received during application registration + * to policy table + * @param device_id Device mac address + * @param device_info Received device parameters + */ + virtual void SetDeviceInfo(const std::string& device_id, + const DeviceInfo& device_info) = 0; + + /** + * @brief Set user consent for application functional groups + * @param permissions User-defined application group pemissions. + * The permissions is not const reference because it may contains + * valid data as well as invalid. So we will remove all invalid data + * from this structure. + */ + virtual void SetUserConsentForApp(const PermissionConsent& permissions) = 0; + + /** + * @brief Get default HMI level for application + * @param policy_app_id Unique application id + * @param default_hmi Default HMI level for application or empty, if value + * was not set + * @return true, if succedeed, otherwise - false + */ + virtual bool GetDefaultHmi(const std::string& policy_app_id, + std::string* default_hmi) const = 0; + + /** + * @brief Get priority for application + * @param policy_app_id Unique application id + * @param priority Priority for application or empty, if value was not set + * @return true, if succedeed, otherwise - false + */ + virtual bool GetPriority(const std::string& policy_app_id, + std::string* priority) const = 0; + + /** + * @brief Get user friendly messages for given RPC messages and language + * @param message_codes RPC message codes + * @param language Language + * @return Array of structs with appropriate message parameters + */ + virtual std::vector<UserFriendlyMessage> GetUserFriendlyMessages( const std::vector<std::string>& message_code, const std::string& language) = 0; - /** - * Checks if the application is revoked - * @param app_id application id - * @return true if application is revoked - */ - virtual bool IsApplicationRevoked(const std::string& app_id) const = 0; - - /** - * @brief Get resulting RPCs permissions for application which started on - * specific device - * @param device_id Device id - * @param policy_app_id Unique application id - * @param permissions Array of functional groups permissions - */ - virtual void GetPermissionsForApp( - const std::string& device_id, const std::string& policy_app_id, + /** + * Checks if the application is revoked + * @param app_id application id + * @return true if application is revoked + */ + virtual bool IsApplicationRevoked(const std::string& app_id) const = 0; + + /** + * @brief Get resulting RPCs permissions for application which started on + * specific device + * @param device_id Device id + * @param policy_app_id Unique application id + * @param permissions Array of functional groups permissions + */ + virtual void GetPermissionsForApp( + const std::string& device_id, + const std::string& policy_app_id, std::vector<FunctionalGroupPermission>& permissions) = 0; - /** - * @brief Gets specific application permissions changes since last policy - * table update - * @param policy_app_id Unique application id - * @return Permissions changes - */ - virtual AppPermissions GetAppPermissionsChanges( - const std::string& policy_app_id) = 0; - - virtual void RemovePendingPermissionChanges(const std::string& app_id) = 0; - - /** - * @brief Return device id, which hosts specific application - * @param Application id, which is required to update device id - */ - virtual std::string& GetCurrentDeviceId(const std::string& policy_app_id) const = 0; - - /** - * @brief Set current system language - * @param language Language - */ - virtual void SetSystemLanguage(const std::string& language) = 0; - - /** - * @brief Set data from GetSystemInfo response to policy table - * @param ccpu_version CCPU version - * @param wers_country_code WERS country code - * @param language System language - */ - virtual void SetSystemInfo(const std::string& ccpu_version, - const std::string& wers_country_code, - const std::string& language) = 0; - - /** - * @brief Send OnPermissionsUpdated for choosen application - * @param application_id - */ - virtual void SendNotificationOnPermissionsUpdated( + /** + * @brief Gets specific application permissions changes since last policy + * table update + * @param policy_app_id Unique application id + * @return Permissions changes + */ + virtual AppPermissions GetAppPermissionsChanges( + const std::string& policy_app_id) = 0; + + virtual void RemovePendingPermissionChanges(const std::string& app_id) = 0; + + /** + * @brief Return device id, which hosts specific application + * @param Application id, which is required to update device id + */ + virtual std::string& GetCurrentDeviceId( + const std::string& policy_app_id) const = 0; + + /** + * @brief Set current system language + * @param language Language + */ + virtual void SetSystemLanguage(const std::string& language) = 0; + + /** + * @brief Set data from GetSystemInfo response to policy table + * @param ccpu_version CCPU version + * @param wers_country_code WERS country code + * @param language System language + */ + virtual void SetSystemInfo(const std::string& ccpu_version, + const std::string& wers_country_code, + const std::string& language) = 0; + + /** + * @brief Send OnPermissionsUpdated for choosen application + * @param application_id + */ + virtual void SendNotificationOnPermissionsUpdated( const std::string& application_id) = 0; - /** - * Marks device as upaired - * @param device_id id device - */ - virtual void MarkUnpairedDevice(const std::string& device_id) = 0; - - /** - * @brief Adds, application to the db or update existed one - * run PTU if policy update is necessary for application. - * @param Application id assigned by Ford to the application - */ - virtual void AddApplication(const std::string& application_id) = 0; - - /** - * @brief Removes unpaired device records and related records from DB - * @param device_ids List of device_id, which should be removed - * @return true, if succedeed, otherwise - false - */ - virtual bool CleanupUnpairedDevices() = 0; - - /** - * @brief Check if app can keep context. - */ - virtual bool CanAppKeepContext(const std::string& app_id) const = 0; - - /** - * @brief Check if app can steal focus. - */ - virtual bool CanAppStealFocus(const std::string& app_id) const = 0; - - /** - * @brief Runs necessary operations, which is depends on external system - * state, e.g. getting system-specific parameters which are need to be - * filled into policy table - */ - virtual void OnSystemReady() = 0; - - /** - * @brief GetNotificationNumber - * @param priority - * @return - */ - virtual uint32_t GetNotificationsNumber(const std::string& priority) const = 0 ; - - /** - * @brief Allows to update Vehicle Identification Number in policy table. - * @param new value for the parameter. - */ - virtual void SetVINValue(const std::string& value) = 0; - - /** - * @brief Checks, if application has policy assigned w/o data consent - * @param policy_app_id Unique application id - * @return true, if policy assigned w/o data consent, otherwise -false - */ - virtual bool IsPredataPolicy(const std::string& policy_app_id) = 0; - - /** - * Returns heart beat timeout - * @param app_id application id - * @return if timeout was set then value in milliseconds greater zero - * otherwise heart beat for specific application isn't set - */ - virtual uint32_t HeartBeatTimeout(const std::string& app_id) const = 0; - - /** - * @brief SaveUpdateStatusRequired alows to save update status. - */ - virtual void SaveUpdateStatusRequired(bool is_update_needed) = 0; - - /** - * @brief Handler on applications search started - */ - virtual void OnAppsSearchStarted() = 0; - - /** - * @brief Handler on applications search completed - */ - virtual void OnAppsSearchCompleted() = 0; - /** - * @brief Gets request types for application - * @param policy_app_id Unique application id - * @return request_types Request types of application - */ - virtual const std::vector<std::string> GetAppRequestTypes( + /** + * Marks device as upaired + * @param device_id id device + */ + virtual void MarkUnpairedDevice(const std::string& device_id) = 0; + + /** + * @brief Adds, application to the db or update existed one + * run PTU if policy update is necessary for application. + * @param Application id assigned by Ford to the application + */ + virtual void AddApplication(const std::string& application_id) = 0; + + /** + * @brief Removes unpaired device records and related records from DB + * @param device_ids List of device_id, which should be removed + * @return true, if succedeed, otherwise - false + */ + virtual bool CleanupUnpairedDevices() = 0; + + /** + * @brief Check if app can keep context. + */ + virtual bool CanAppKeepContext(const std::string& app_id) const = 0; + + /** + * @brief Check if app can steal focus. + */ + virtual bool CanAppStealFocus(const std::string& app_id) const = 0; + + /** + * @brief Runs necessary operations, which is depends on external system + * state, e.g. getting system-specific parameters which are need to be + * filled into policy table + */ + virtual void OnSystemReady() = 0; + + /** + * @brief GetNotificationNumber + * @param priority + * @return + */ + virtual uint32_t GetNotificationsNumber( + const std::string& priority) const = 0; + + /** + * @brief Allows to update Vehicle Identification Number in policy table. + * @param new value for the parameter. + */ + virtual void SetVINValue(const std::string& value) = 0; + + /** + * @brief Checks, if application has policy assigned w/o data consent + * @param policy_app_id Unique application id + * @return true, if policy assigned w/o data consent, otherwise -false + */ + virtual bool IsPredataPolicy(const std::string& policy_app_id) = 0; + + /** + * Returns heart beat timeout + * @param app_id application id + * @return if timeout was set then value in milliseconds greater zero + * otherwise heart beat for specific application isn't set + */ + virtual uint32_t HeartBeatTimeout(const std::string& app_id) const = 0; + + /** + * @brief SaveUpdateStatusRequired alows to save update status. + */ + virtual void SaveUpdateStatusRequired(bool is_update_needed) = 0; + + /** + * @brief Handler on applications search started + */ + virtual void OnAppsSearchStarted() = 0; + + /** + * @brief Handler on applications search completed + */ + virtual void OnAppsSearchCompleted() = 0; + /** + * @brief Gets request types for application + * @param policy_app_id Unique application id + * @return request_types Request types of application + */ + virtual const std::vector<std::string> GetAppRequestTypes( const std::string policy_app_id) const = 0; - - /** - * @brief Get information about vehicle - */ - virtual const VehicleInfo GetVehicleInfo() const = 0; - - /** - * @brief OnAppRegisteredOnMobile alows to handle event when application were - * succesfully registered on mobile device. - * It will send OnAppPermissionSend notification and will try to start PTU. - * - * @param application_id registered application. - */ - virtual void OnAppRegisteredOnMobile(const std::string& application_id) = 0; - - /** - * @brief RetrieveCertificate Allows to obtain certificate in order - * to start secure connection. - * - * @return The certificate in PKCS#7 format. - */ - virtual std::string RetrieveCertificate() const = 0; - - virtual const PolicySettings& get_settings() const = 0; - - protected: - /** - * Checks is PT exceeded IgnitionCycles - * @return true if exceeded - */ - virtual bool ExceededIgnitionCycles() = 0; - - /** - * Checks is PT exceeded days - * @return true if exceeded - */ - virtual bool ExceededDays() = 0; - - /** - * @brief StartPTExchange allows to start PTU. The function will check - * if one is required and starts the update flow in only case when previous - * condition is true. - */ - virtual void StartPTExchange() = 0; + + /** + * @brief Get information about vehicle + */ + virtual const VehicleInfo GetVehicleInfo() const = 0; + + /** + * @brief OnAppRegisteredOnMobile alows to handle event when application were + * succesfully registered on mobile device. + * It will send OnAppPermissionSend notification and will try to start PTU. + * + * @param application_id registered application. + */ + virtual void OnAppRegisteredOnMobile(const std::string& application_id) = 0; + + /** + * @brief RetrieveCertificate Allows to obtain certificate in order + * to start secure connection. + * + * @return The certificate in PKCS#7 format. + */ + virtual std::string RetrieveCertificate() const = 0; + + virtual const PolicySettings& get_settings() const = 0; + + protected: + /** + * Checks is PT exceeded IgnitionCycles + * @return true if exceeded + */ + virtual bool ExceededIgnitionCycles() = 0; + + /** + * Checks is PT exceeded days + * @return true if exceeded + */ + virtual bool ExceededDays() = 0; + + /** + * @brief StartPTExchange allows to start PTU. The function will check + * if one is required and starts the update flow in only case when previous + * condition is true. + */ + virtual void StartPTExchange() = 0; }; } // namespace policy diff --git a/src/components/policy/src/policy/src/policy_manager_impl.cc b/src/components/policy/src/policy/src/policy_manager_impl.cc index fb3aac7ff0..ac270d5862 100644 --- a/src/components/policy/src/policy/src/policy_manager_impl.cc +++ b/src/components/policy/src/policy/src/policy_manager_impl.cc @@ -54,7 +54,7 @@ policy::PolicyManager* CreateManager() { return new policy::PolicyManagerImpl(); } void DeleteManager(policy::PolicyManager* pm) { - delete pm; + delete pm; } namespace { @@ -103,10 +103,10 @@ utils::SharedPtr<policy_table::Table> PolicyManagerImpl::ParseArray( Json::Value value; Json::Reader reader; if (reader.parse(json.c_str(), value)) { - //For PT Update received from SDL Server. - if (value["data"].size()!=0) { + // For PT Update received from SDL Server. + if (value["data"].size() != 0) { Json::Value data = value["data"]; - //First Element in + // First Element in return new policy_table::Table(&data[0]); } else { return new policy_table::Table(&value); @@ -123,10 +123,10 @@ void PolicyManagerImpl::CheckTriggers() { const bool exceed_ignition_cycles = ExceededIgnitionCycles(); const bool exceed_days = ExceededDays(); - LOG4CXX_DEBUG( - logger_, - "\nDays exceeded: " << std::boolalpha << exceed_ignition_cycles << - "\nStatusUpdateRequired: " << std::boolalpha<< exceed_days); + LOG4CXX_DEBUG(logger_, + "\nDays exceeded: " << std::boolalpha << exceed_ignition_cycles + << "\nStatusUpdateRequired: " + << std::boolalpha << exceed_days); if (exceed_ignition_cycles || exceed_days) { update_status_manager_.ScheduleUpdate(); @@ -137,16 +137,16 @@ bool PolicyManagerImpl::LoadPT(const std::string& file, const BinaryMessage& pt_content) { LOG4CXX_INFO(logger_, "LoadPT of size " << pt_content.size()); - #ifdef USE_HMI_PTU_DECRYPTION +#ifdef USE_HMI_PTU_DECRYPTION // Assuemes Policy Table was parsed, formatted, and/or decrypted by // the HMI after system request before calling OnReceivedPolicyUpdate // Parse message into table struct utils::SharedPtr<policy_table::Table> pt_update = Parse(pt_content); - #else - //Message Received from server unecnrypted with PTU in first element - //of 'data' array. No Parsing was done by HMI. +#else + // Message Received from server unecnrypted with PTU in first element + // of 'data' array. No Parsing was done by HMI. utils::SharedPtr<policy_table::Table> pt_update = ParseArray(pt_content); - #endif +#endif if (!pt_update) { LOG4CXX_WARN(logger_, "Parsed table pointer is 0."); update_status_manager_.OnWrongUpdateReceived(); @@ -194,7 +194,8 @@ bool PolicyManagerImpl::LoadPT(const std::string& file, } if (pt_update->policy_table.module_config.certificate.is_initialized()) { - listener_->OnCertificateUpdated(*(pt_update->policy_table.module_config.certificate)); + listener_->OnCertificateUpdated( + *(pt_update->policy_table.module_config.certificate)); } std::map<std::string, StringArray> app_hmi_types; @@ -233,11 +234,10 @@ void PolicyManagerImpl::CheckPermissionsChanges( } void PolicyManagerImpl::PrepareNotificationData( - const policy_table::FunctionalGroupings& groups, - const policy_table::Strings& group_names, - const std::vector<FunctionalGroupPermission>& group_permission, - Permissions& notification_data) { - + const policy_table::FunctionalGroupings& groups, + const policy_table::Strings& group_names, + const std::vector<FunctionalGroupPermission>& group_permission, + Permissions& notification_data) { LOG4CXX_INFO(logger_, "Preparing data for notification."); ProcessFunctionalGroup processor(groups, group_permission, notification_data); std::for_each(group_names.begin(), group_names.end(), processor); @@ -264,7 +264,7 @@ bool PolicyManagerImpl::RequestPTUpdate() { Json::FastWriter writer; std::string message_string = writer.write(value); - LOG4CXX_DEBUG(logger_, "Snapshot contents is : " << message_string ); + LOG4CXX_DEBUG(logger_, "Snapshot contents is : " << message_string); BinaryMessage update(message_string.begin(), message_string.end()); @@ -286,14 +286,16 @@ void PolicyManagerImpl::StartPTExchange() { if (update_status_manager_.IsAppsSearchInProgress()) { update_status_manager_.ScheduleUpdate(); - LOG4CXX_INFO(logger_, "Starting exchange skipped, since applications " + LOG4CXX_INFO(logger_, + "Starting exchange skipped, since applications " "search is in progress."); return; } if (update_status_manager_.IsUpdatePending()) { update_status_manager_.ScheduleUpdate(); - LOG4CXX_INFO(logger_, "Starting exchange skipped, since another exchange " + LOG4CXX_INFO(logger_, + "Starting exchange skipped, since another exchange " "is in progress."); return; } @@ -339,13 +341,12 @@ const VehicleInfo PolicyManagerImpl::GetVehicleInfo() const { void PolicyManagerImpl::CheckPermissions(const PTString& app_id, const PTString& hmi_level, - const PTString& rpc, - const RPCParams& rpc_params, - CheckPermissionResult& result) { - LOG4CXX_INFO( - logger_, - "CheckPermissions for " << app_id << " and rpc " << rpc << " for " - << hmi_level << " level."); + const PTString& rpc, + const RPCParams& rpc_params, + CheckPermissionResult& result) { + LOG4CXX_INFO(logger_, + "CheckPermissions for " << app_id << " and rpc " << rpc + << " for " << hmi_level << " level."); cache_->CheckPermissions(app_id, hmi_level, rpc, result); } @@ -357,11 +358,12 @@ bool PolicyManagerImpl::ResetUserConsent() { } void PolicyManagerImpl::SendNotificationOnPermissionsUpdated( - const std::string& application_id) { + const std::string& application_id) { LOG4CXX_AUTO_TRACE(logger_); const std::string device_id = GetCurrentDeviceId(application_id); if (device_id.empty()) { - LOG4CXX_WARN(logger_, "Couldn't find device info for application id " + LOG4CXX_WARN(logger_, + "Couldn't find device info for application id " "'" << application_id << "'"); return; } @@ -374,24 +376,27 @@ void PolicyManagerImpl::SendNotificationOnPermissionsUpdated( policy_table::Strings app_groups; std::vector<FunctionalGroupPermission>::const_iterator it = - app_group_permissions.begin(); + app_group_permissions.begin(); std::vector<FunctionalGroupPermission>::const_iterator it_end = - app_group_permissions.end(); + app_group_permissions.end(); for (; it != it_end; ++it) { app_groups.push_back((*it).group_name); } Permissions notification_data; - PrepareNotificationData(functional_groupings, app_groups, app_group_permissions, + PrepareNotificationData(functional_groupings, + app_groups, + app_group_permissions, notification_data); - LOG4CXX_INFO(logger_, "Send notification for application_id:" << application_id); + LOG4CXX_INFO(logger_, + "Send notification for application_id:" << application_id); std::string default_hmi; default_hmi = "NONE"; - listener()->OnPermissionsUpdated(application_id, notification_data, - default_hmi); + listener()->OnPermissionsUpdated( + application_id, notification_data, default_hmi); } bool PolicyManagerImpl::CleanupUnpairedDevices() { @@ -401,13 +406,13 @@ bool PolicyManagerImpl::CleanupUnpairedDevices() { } DeviceConsent PolicyManagerImpl::GetUserConsentForDevice( - const std::string& device_id) const { + const std::string& device_id) const { LOG4CXX_AUTO_TRACE(logger_); return kDeviceAllowed; } void PolicyManagerImpl::SetUserConsentForDevice(const std::string& device_id, - bool is_allowed) { + bool is_allowed) { LOG4CXX_AUTO_TRACE(logger_); LOG4CXX_DEBUG(logger_, "Device :" << device_id); DeviceConsent current_consent = GetUserConsentForDevice(device_id); @@ -422,13 +427,13 @@ void PolicyManagerImpl::SetUserConsentForDevice(const std::string& device_id, } bool PolicyManagerImpl::ReactOnUserDevConsentForApp(const std::string app_id, - bool is_device_allowed) { + bool is_device_allowed) { return true; } bool PolicyManagerImpl::GetInitialAppData(const std::string& application_id, - StringArray* nicknames, - StringArray* app_hmi_types) { + StringArray* nicknames, + StringArray* app_hmi_types) { LOG4CXX_AUTO_TRACE(logger_); const bool result = nicknames && app_hmi_types; if (result) { @@ -466,7 +471,7 @@ PermissionConsent PolicyManagerImpl::EnsureCorrectPermissionConsent( std::vector<FunctionalGroupPermission>::const_iterator it_end = permissions_to_check.group_permissions.end(); - for (;it != it_end; ++it) { + for (; it != it_end; ++it) { std::vector<FunctionalGroupPermission>::const_iterator it_curr = current_user_consents.begin(); std::vector<FunctionalGroupPermission>::const_iterator it_curr_end = @@ -491,15 +496,15 @@ void PolicyManagerImpl::CheckPendingPermissionsChanges( std::map<std::string, AppPermissions>::iterator it_pending = app_permissions_diff_.find(policy_app_id); if (app_permissions_diff_.end() == it_pending) { - LOG4CXX_WARN(logger_, - "No pending permissions had been found for appID: " - << policy_app_id); + LOG4CXX_WARN( + logger_, + "No pending permissions had been found for appID: " << policy_app_id); return; } - LOG4CXX_DEBUG(logger_, - "Pending permissions had been found for appID: " - << policy_app_id); + LOG4CXX_DEBUG( + logger_, + "Pending permissions had been found for appID: " << policy_app_id); // Change appPermissionsConsentNeeded depending on unconsented groups // presence @@ -510,17 +515,17 @@ void PolicyManagerImpl::CheckPendingPermissionsChanges( for (; it_groups != it_end_groups; ++it_groups) { if (policy::kGroupUndefined == it_groups->state) { - LOG4CXX_DEBUG(logger_, - "Unconsented groups still present for appID: " - << policy_app_id); + LOG4CXX_DEBUG( + logger_, + "Unconsented groups still present for appID: " << policy_app_id); it_pending->second.appPermissionsConsentNeeded = true; return; } } - LOG4CXX_DEBUG(logger_, - "Unconsented groups not present anymore for appID: " - << policy_app_id); + LOG4CXX_DEBUG( + logger_, + "Unconsented groups not present anymore for appID: " << policy_app_id); it_pending->second.appPermissionsConsentNeeded = false; return; } @@ -535,9 +540,9 @@ bool PolicyManagerImpl::GetDefaultHmi(const std::string& policy_app_id, LOG4CXX_AUTO_TRACE(logger_); const std::string device_id = GetCurrentDeviceId(policy_app_id); DeviceConsent device_consent = GetUserConsentForDevice(device_id); - const std::string app_id = - policy::kDeviceAllowed != device_consent ? kPreDataConsentId : - policy_app_id; + const std::string app_id = policy::kDeviceAllowed != device_consent + ? kPreDataConsentId + : policy_app_id; return cache_->GetDefaultHMI(app_id, *default_hmi); } @@ -553,20 +558,20 @@ bool PolicyManagerImpl::GetPriority(const std::string& policy_app_id, } std::vector<UserFriendlyMessage> PolicyManagerImpl::GetUserFriendlyMessages( - const std::vector<std::string>& message_code, const std::string& language) { + const std::vector<std::string>& message_code, const std::string& language) { return cache_->GetUserFriendlyMsg(message_code, language); } void PolicyManagerImpl::GetUserConsentForApp( - const std::string& device_id, const std::string& policy_app_id, - std::vector<FunctionalGroupPermission>& permissions) { + const std::string& device_id, + const std::string& policy_app_id, + std::vector<FunctionalGroupPermission>& permissions) { LOG4CXX_AUTO_TRACE(logger_); FunctionalIdType group_types; - if (!cache_->GetPermissionsForApp(device_id, policy_app_id, - group_types)) { - LOG4CXX_WARN(logger_, "Can't get user permissions for app " - << policy_app_id); + if (!cache_->GetPermissionsForApp(device_id, policy_app_id, group_types)) { + LOG4CXX_WARN(logger_, + "Can't get user permissions for app " << policy_app_id); return; } @@ -581,7 +586,7 @@ void PolicyManagerImpl::GetUserConsentForApp( FunctionalGroupNames::const_iterator it = group_names.begin(); FunctionalGroupNames::const_iterator it_end = group_names.end(); FunctionalGroupIDs auto_allowed_groups; - for (;it != it_end; ++it) { + for (; it != it_end; ++it) { if (it->second.first.empty()) { auto_allowed_groups.push_back(it->first); } @@ -601,13 +606,14 @@ void PolicyManagerImpl::GetUserConsentForApp( } else if (cache_->IsPredataPolicy(policy_app_id)) { allowed_groups = ExcludeSame(no_auto, predataconsented_groups); } - FillFunctionalGroupPermissions(allowed_groups, group_names, - kGroupAllowed, permissions); + FillFunctionalGroupPermissions( + allowed_groups, group_names, kGroupAllowed, permissions); } void PolicyManagerImpl::GetPermissionsForApp( - const std::string& device_id, const std::string& policy_app_id, - std::vector<FunctionalGroupPermission>& permissions) { + const std::string& device_id, + const std::string& policy_app_id, + std::vector<FunctionalGroupPermission>& permissions) { LOG4CXX_AUTO_TRACE(logger_); std::string app_id_to_check = policy_app_id; @@ -622,10 +628,9 @@ void PolicyManagerImpl::GetPermissionsForApp( } FunctionalIdType group_types; - if (!cache_->GetPermissionsForApp(device_id, app_id_to_check, - group_types)) { - LOG4CXX_WARN(logger_, "Can't get user permissions for app " - << policy_app_id); + if (!cache_->GetPermissionsForApp(device_id, app_id_to_check, group_types)) { + LOG4CXX_WARN(logger_, + "Can't get user permissions for app " << policy_app_id); return; } @@ -641,13 +646,12 @@ void PolicyManagerImpl::GetPermissionsForApp( // So, check if application in the one of these mode. if (allowed_by_default) { LOG4CXX_INFO(logger_, "Get auto allowed groups"); - GroupType type = (kDefaultId == app_id_to_check ? - kTypeDefault : kTypePreDataConsented); + GroupType type = + (kDefaultId == app_id_to_check ? kTypeDefault : kTypePreDataConsented); - FillFunctionalGroupPermissions(group_types[type], group_names, - kGroupAllowed, permissions); + FillFunctionalGroupPermissions( + group_types[type], group_names, kGroupAllowed, permissions); } else { - // The code bellow allows to process application which // has specific permissions(not default and pre_DataConsent). @@ -656,22 +660,20 @@ void PolicyManagerImpl::GetPermissionsForApp( // In case of GENIVI all groups are allowed FunctionalGroupIDs common_allowed = all_groups; - FillFunctionalGroupPermissions(common_allowed, group_names, - kGroupAllowed, permissions); + FillFunctionalGroupPermissions( + common_allowed, group_names, kGroupAllowed, permissions); } return; } std::string& PolicyManagerImpl::GetCurrentDeviceId( - const std::string& policy_app_id) const { + const std::string& policy_app_id) const { LOG4CXX_INFO(logger_, "GetDeviceInfo"); - last_device_id_ = - listener()->OnCurrentDeviceIdUpdateRequired(policy_app_id); + last_device_id_ = listener()->OnCurrentDeviceIdUpdateRequired(policy_app_id); return last_device_id_; } -void PolicyManagerImpl::SetSystemLanguage(const std::string& language) { -} +void PolicyManagerImpl::SetSystemLanguage(const std::string& language) {} void PolicyManagerImpl::SetSystemInfo(const std::string& ccpu_version, const std::string& wers_country_code, @@ -702,12 +704,10 @@ bool PolicyManagerImpl::IsPTValid( policy_table::PolicyTableType type) const { policy_table->SetPolicyTableType(type); if (!policy_table->is_valid()) { - LOG4CXX_ERROR( - logger_, "Policy table is not valid."); + LOG4CXX_ERROR(logger_, "Policy table is not valid."); rpc::ValidationReport report("policy_table"); policy_table->ReportErrors(&report); - LOG4CXX_DEBUG(logger_, - "Errors: " << rpc::PrettyFormat(report)); + LOG4CXX_DEBUG(logger_, "Errors: " << rpc::PrettyFormat(report)); return false; } return true; @@ -719,10 +719,10 @@ const PolicySettings& PolicyManagerImpl::get_settings() const { } bool PolicyManagerImpl::ExceededDays() { - LOG4CXX_AUTO_TRACE(logger_); + LOG4CXX_AUTO_TRACE(logger_); - TimevalStruct current_time = date_time::DateTime::getCurrentTime(); - const int kSecondsInDay = 60 * 60 * 24; + TimevalStruct current_time = date_time::DateTime::getCurrentTime(); + const int kSecondsInDay = 60 * 60 * 24; const int days = current_time.tv_sec / kSecondsInDay; return 0 == cache_->DaysBeforeExchange(days); @@ -800,26 +800,25 @@ void PolicyManagerImpl::OnExceededTimeout() { void PolicyManagerImpl::OnUpdateStarted() { int update_timeout = TimeoutExchange(); - LOG4CXX_DEBUG(logger_, "Update timeout will be set to (sec): " - << update_timeout); + LOG4CXX_DEBUG(logger_, + "Update timeout will be set to (sec): " << update_timeout); update_status_manager_.OnUpdateSentOut(update_timeout); cache_->SaveUpdateRequired(true); } void PolicyManagerImpl::PTUpdatedAt(Counters counter, int value) { LOG4CXX_AUTO_TRACE(logger_); - cache_->SetCountersPassedForSuccessfulUpdate( - counter, value); + cache_->SetCountersPassedForSuccessfulUpdate(counter, value); cache_->ResetIgnitionCycles(); } void PolicyManagerImpl::Increment(usage_statistics::GlobalCounterId type) { - LOG4CXX_INFO(logger_, "Increment without app id" ); + LOG4CXX_INFO(logger_, "Increment without app id"); cache_->Increment(type); } void PolicyManagerImpl::Increment(const std::string& app_id, - usage_statistics::AppCounterId type){ + usage_statistics::AppCounterId type) { LOG4CXX_DEBUG(logger_, "Increment " << app_id << " AppCounter: " << type); cache_->Increment(app_id, type); } @@ -847,8 +846,7 @@ bool PolicyManagerImpl::IsConsentNeeded(const std::string& app_id) { return false; } -void PolicyManagerImpl::SetVINValue(const std::string& value) { -} +void PolicyManagerImpl::SetVINValue(const std::string& value) {} AppPermissions PolicyManagerImpl::GetAppPermissionsChanges( const std::string& policy_app_id) { @@ -866,7 +864,7 @@ AppPermissions PolicyManagerImpl::GetAppPermissionsChanges( } void PolicyManagerImpl::RemovePendingPermissionChanges( - const std::string& app_id) { + const std::string& app_id) { app_permissions_diff_.erase(app_id); } @@ -878,8 +876,7 @@ bool PolicyManagerImpl::CanAppStealFocus(const std::string& app_id) const { return cache_->CanAppStealFocus(app_id); } -void PolicyManagerImpl::MarkUnpairedDevice(const std::string& device_id) { -} +void PolicyManagerImpl::MarkUnpairedDevice(const std::string& device_id) {} void PolicyManagerImpl::OnAppRegisteredOnMobile( const std::string& application_id) { @@ -906,14 +903,14 @@ void PolicyManagerImpl::AddApplication(const std::string& application_id) { } } -void PolicyManagerImpl::RemoveAppConsentForGroup(const std::string& app_id, - const std::string& group_name) { - cache_->RemoveAppConsentForGroup(app_id, group_name); +void PolicyManagerImpl::RemoveAppConsentForGroup( + const std::string& app_id, const std::string& group_name) { + cache_->RemoveAppConsentForGroup(app_id, group_name); } -bool PolicyManagerImpl::IsPredataPolicy(const std::string &policy_app_id) { - LOG4CXX_INFO(logger_, "IsPredataApp"); - return cache_->IsPredataPolicy(policy_app_id); +bool PolicyManagerImpl::IsPredataPolicy(const std::string& policy_app_id) { + LOG4CXX_INFO(logger_, "IsPredataApp"); + return cache_->IsPredataPolicy(policy_app_id); } void PolicyManagerImpl::AddNewApplication(const std::string& application_id, @@ -927,8 +924,8 @@ void PolicyManagerImpl::PromoteExistedApplication( const std::string& application_id, DeviceConsent device_consent) { // If device consent changed to allowed during application being // disconnected, app permissions should be changed also - if (kDeviceAllowed == device_consent - && cache_->IsPredataPolicy(application_id)) { + if (kDeviceAllowed == device_consent && + cache_->IsPredataPolicy(application_id)) { cache_->SetDefaultPolicy(application_id); } } @@ -949,8 +946,7 @@ bool PolicyManagerImpl::ResetPT(const std::string& file_name) { bool PolicyManagerImpl::CheckAppStorageFolder() const { LOG4CXX_AUTO_TRACE(logger_); - const std::string app_storage_folder = - get_settings().app_storage_folder(); + const std::string app_storage_folder = get_settings().app_storage_folder(); LOG4CXX_DEBUG(logger_, "AppStorageFolder " << app_storage_folder); if (!file_system::DirectoryExists(app_storage_folder)) { LOG4CXX_WARN(logger_, @@ -959,9 +955,9 @@ bool PolicyManagerImpl::CheckAppStorageFolder() const { } if (!(file_system::IsWritingAllowed(app_storage_folder) && file_system::IsReadingAllowed(app_storage_folder))) { - LOG4CXX_WARN( - logger_, - "Storage directory doesn't have read/write permissions " << app_storage_folder); + LOG4CXX_WARN(logger_, + "Storage directory doesn't have read/write permissions " + << app_storage_folder); return false; } return true; diff --git a/src/components/policy/src/policy/src/sql_pt_representation.cc b/src/components/policy/src/policy/src/sql_pt_representation.cc index fd5040cd62..d2c8ac05fa 100644 --- a/src/components/policy/src/policy/src/sql_pt_representation.cc +++ b/src/components/policy/src/policy/src/sql_pt_representation.cc @@ -51,7 +51,8 @@ namespace policy { CREATE_LOGGERPTR_GLOBAL(logger_, "Policy") namespace { -template<typename T, typename K> void InsertUnique(K value, T* array) { +template <typename T, typename K> +void InsertUnique(K value, T* array) { uint32_t i = 0; for (; i < array->size() && array->at(i) != value; ++i) { continue; @@ -65,8 +66,7 @@ template<typename T, typename K> void InsertUnique(K value, T* array) { const std::string SQLPTRepresentation::kDatabaseName = "policy"; SQLPTRepresentation::SQLPTRepresentation() - : db_(new utils::dbms::SQLDatabase(kDatabaseName)) { -} + : db_(new utils::dbms::SQLDatabase(kDatabaseName)) {} SQLPTRepresentation::~SQLPTRepresentation() { db_->Close(); @@ -80,9 +80,9 @@ void SQLPTRepresentation::CheckPermissions(const PTString& app_id, utils::dbms::SQLQuery query(db()); if (!query.Prepare(sql_pt::kSelectRpc)) { - LOG4CXX_WARN( - logger_, - "Incorrect select statement from rpcs" << query.LastError().text()); + LOG4CXX_WARN(logger_, + "Incorrect select statement from rpcs" + << query.LastError().text()); return; } query.Bind(0, app_id); @@ -91,11 +91,10 @@ void SQLPTRepresentation::CheckPermissions(const PTString& app_id, bool ret = query.Next(); result.hmi_level_permitted = ret ? kRpcAllowed : kRpcDisallowed; - LOG4CXX_INFO( - logger_, - "Level is " - << (result.hmi_level_permitted == kRpcAllowed ? "permitted" - : "not permitted")); + LOG4CXX_INFO(logger_, + "Level is " << (result.hmi_level_permitted == kRpcAllowed + ? "permitted" + : "not permitted")); std::string parameter; while (ret) { if (!query.IsNull(0)) { @@ -136,8 +135,8 @@ int SQLPTRepresentation::KilometersBeforeExchange(int current) { int limit = query.GetInteger(0); int last = query.GetInteger(1); - if (limit < 0 || last < 0 || current < 0 || current < last - || limit < (current - last)) { + if (limit < 0 || last < 0 || current < 0 || current < last || + limit < (current - last)) { return 0; } @@ -145,7 +144,7 @@ int SQLPTRepresentation::KilometersBeforeExchange(int current) { } bool SQLPTRepresentation::SetCountersPassedForSuccessfulUpdate( - int kilometers, int days_after_epoch) { + int kilometers, int days_after_epoch) { LOG4CXX_AUTO_TRACE(logger_); utils::dbms::SQLQuery query(db()); if (!query.Prepare(sql_pt::kUpdateCountersSuccessfulUpdate)) { @@ -175,8 +174,8 @@ int SQLPTRepresentation::DaysBeforeExchange(int current) { return limit; } - if (limit < 0 || last < 0 || current < 0 || current < last - || limit < (current - last)) { + if (limit < 0 || last < 0 || current < 0 || current < last || + limit < (current - last)) { return 0; } @@ -207,7 +206,7 @@ bool SQLPTRepresentation::SecondsBetweenRetries(std::vector<int>* seconds) { } std::vector<UserFriendlyMessage> SQLPTRepresentation::GetUserFriendlyMsg( - const std::vector<std::string>& msg_codes, const std::string& language) { + const std::vector<std::string>& msg_codes, const std::string& language) { std::vector<UserFriendlyMessage> result; std::vector<std::string>::const_iterator it = msg_codes.begin(); std::vector<std::string>::const_iterator it_end = msg_codes.end(); @@ -220,8 +219,8 @@ std::vector<UserFriendlyMessage> SQLPTRepresentation::GetUserFriendlyMsg( } EndpointUrls SQLPTRepresentation::GetUpdateUrls(int service_type) { - LOG4CXX_INFO(logger_, "SQLPTRepresentation::GetUpdateUrls for " - << service_type); + LOG4CXX_INFO(logger_, + "SQLPTRepresentation::GetUpdateUrls for " << service_type); utils::dbms::SQLQuery query(db()); EndpointUrls ret; if (query.Prepare(sql_pt::kSelectEndpoint)) { @@ -248,7 +247,7 @@ std::string SQLPTRepresentation::GetLockScreenIconUrl() const { query.Bind(0, std::string("lock_screen_icon_url")); query.Bind(1, std::string("default")); - if(!query.Exec()) { + if (!query.Exec()) { LOG4CXX_WARN(logger_, "Incorrect select from notifications by priority."); return ret; } @@ -263,12 +262,12 @@ std::string SQLPTRepresentation::GetLockScreenIconUrl() const { return ret; } - int SQLPTRepresentation::GetNotificationsNumber(const std::string& priority) { LOG4CXX_AUTO_TRACE(logger_); utils::dbms::SQLQuery query(db()); if (!query.Prepare(sql_pt::kSelectNotificationsPerPriority)) { - LOG4CXX_WARN(logger_, "Incorrect select statement for priority " + LOG4CXX_WARN(logger_, + "Incorrect select statement for priority " "notification number."); return 0; } @@ -315,41 +314,41 @@ bool SQLPTRepresentation::GetPriority(const std::string& policy_app_id, return true; } -InitResult SQLPTRepresentation::Init(const PolicySettings *settings) { - settings_ = settings; +InitResult SQLPTRepresentation::Init(const PolicySettings* settings) { + settings_ = settings; LOG4CXX_AUTO_TRACE(logger_); #ifdef BUILD_TESTS open_counter_ = 0; -#endif // BUILD_TESTS +#endif // BUILD_TESTS if (!db_->Open()) { LOG4CXX_ERROR(logger_, "Failed opening database."); LOG4CXX_INFO(logger_, "Starting opening retries."); - const uint16_t attempts = - get_settings().attempts_to_open_policy_db(); + const uint16_t attempts = get_settings().attempts_to_open_policy_db(); LOG4CXX_DEBUG(logger_, "Total attempts number is: " << attempts); bool is_opened = false; const uint16_t open_attempt_timeout_ms = get_settings().open_attempt_timeout_ms(); const useconds_t sleep_interval_mcsec = open_attempt_timeout_ms * 1000; - LOG4CXX_DEBUG(logger_, "Open attempt timeout(ms) is: " - << open_attempt_timeout_ms); + LOG4CXX_DEBUG(logger_, + "Open attempt timeout(ms) is: " << open_attempt_timeout_ms); for (int i = 0; i < attempts; ++i) { usleep(sleep_interval_mcsec); - LOG4CXX_INFO(logger_, "Attempt: " << i+1); + LOG4CXX_INFO(logger_, "Attempt: " << i + 1); #ifdef BUILD_TESTS ++open_counter_; -#endif // BUILD_TESTS - if (db_->Open()){ +#endif // BUILD_TESTS + if (db_->Open()) { LOG4CXX_INFO(logger_, "Database opened."); is_opened = true; break; } } if (!is_opened) { - LOG4CXX_ERROR(logger_, "Open retry sequence failed. Tried " - << attempts << " attempts with " - << open_attempt_timeout_ms - << " open timeout(ms) for each."); + LOG4CXX_ERROR(logger_, + "Open retry sequence failed. Tried " + << attempts << " attempts with " + << open_attempt_timeout_ms + << " open timeout(ms) for each."); return InitResult::FAIL; } } @@ -374,8 +373,9 @@ InitResult SQLPTRepresentation::Init(const PolicySettings *settings) { utils::dbms::SQLQuery check_first_run(db()); if (check_first_run.Prepare(sql_pt::kIsFirstRun) && check_first_run.Next()) { - LOG4CXX_INFO(logger_, "Selecting is first run " - << check_first_run.GetBoolean(0)); + LOG4CXX_INFO(logger_, + "Selecting is first run " + << check_first_run.GetBoolean(0)); if (check_first_run.GetBoolean(0)) { utils::dbms::SQLQuery set_not_first_run(db()); set_not_first_run.Exec(sql_pt::kSetNotFirstRun); @@ -398,14 +398,14 @@ InitResult SQLPTRepresentation::Init(const PolicySettings *settings) { utils::dbms::SQLQuery query(db()); if (!query.Exec(sql_pt::kCreateSchema)) { LOG4CXX_ERROR( - logger_, - "Failed creating schema of database: " << query.LastError().text()); + logger_, + "Failed creating schema of database: " << query.LastError().text()); return InitResult::FAIL; } if (!query.Exec(sql_pt::kInsertInitData)) { LOG4CXX_ERROR( - logger_, - "Failed insert init data to database: " << query.LastError().text()); + logger_, + "Failed insert init data to database: " << query.LastError().text()); return InitResult::FAIL; } return InitResult::SUCCESS; @@ -444,13 +444,13 @@ bool SQLPTRepresentation::Clear() { utils::dbms::SQLQuery query(db()); if (!query.Exec(sql_pt::kDeleteData)) { LOG4CXX_ERROR(logger_, - "Failed clearing database: " << query.LastError().text()); + "Failed clearing database: " << query.LastError().text()); return false; } if (!query.Exec(sql_pt::kInsertInitData)) { LOG4CXX_ERROR( - logger_, - "Failed insert init data to database: " << query.LastError().text()); + logger_, + "Failed insert init data to database: " << query.LastError().text()); return false; } return true; @@ -465,21 +465,21 @@ bool SQLPTRepresentation::RefreshDB() { } if (!query.Exec(sql_pt::kCreateSchema)) { LOG4CXX_ERROR( - logger_, - "Failed creating schema of database: " << query.LastError().text()); + logger_, + "Failed creating schema of database: " << query.LastError().text()); return false; } if (!query.Exec(sql_pt::kInsertInitData)) { LOG4CXX_ERROR( - logger_, - "Failed insert init data to database: " << query.LastError().text()); + logger_, + "Failed insert init data to database: " << query.LastError().text()); return false; } return true; } -utils::SharedPtr<policy_table::Table> -SQLPTRepresentation::GenerateSnapshot() const { +utils::SharedPtr<policy_table::Table> SQLPTRepresentation::GenerateSnapshot() + const { LOG4CXX_AUTO_TRACE(logger_); utils::SharedPtr<policy_table::Table> table = new policy_table::Table(); GatherModuleMeta(&*table->policy_table.module_meta); @@ -488,20 +488,20 @@ SQLPTRepresentation::GenerateSnapshot() const { GatherDeviceData(&*table->policy_table.device_data); GatherFunctionalGroupings(&table->policy_table.functional_groupings); GatherConsumerFriendlyMessages( - &*table->policy_table.consumer_friendly_messages); + &*table->policy_table.consumer_friendly_messages); GatherApplicationPoliciesSection(&table->policy_table.app_policies_section); return table; } void SQLPTRepresentation::GatherModuleMeta( - policy_table::ModuleMeta* meta) const { + policy_table::ModuleMeta* meta) const { LOG4CXX_INFO(logger_, "Gather Module Meta Info"); meta->mark_initialized(); // Section Module Meta is empty for SDL specific } void SQLPTRepresentation::GatherModuleConfig( - policy_table::ModuleConfig* config) const { + policy_table::ModuleConfig* config) const { LOG4CXX_INFO(logger_, "Gather Configuration Info"); utils::dbms::SQLQuery query(db()); if (!query.Prepare(sql_pt::kSelectModuleConfig) || !query.Next()) { @@ -526,8 +526,8 @@ void SQLPTRepresentation::GatherModuleConfig( while (endpoints.Next()) { std::stringstream stream; stream << "0x0" << endpoints.GetInteger(1); - config->endpoints[stream.str()][endpoints.GetString(2)] - .push_back(endpoints.GetString(0)); + config->endpoints[stream.str()][endpoints.GetString(2)].push_back( + endpoints.GetString(0)); } } @@ -537,7 +537,7 @@ void SQLPTRepresentation::GatherModuleConfig( } else { while (notifications.Next()) { config->notifications_per_minute_by_priority[notifications.GetString(0)] = - notifications.GetInteger(1); + notifications.GetInteger(1); } } utils::dbms::SQLQuery seconds(db()); @@ -552,7 +552,7 @@ void SQLPTRepresentation::GatherModuleConfig( } bool SQLPTRepresentation::GatherUsageAndErrorCounts( - policy_table::UsageAndErrorCounts* counts) const { + policy_table::UsageAndErrorCounts* counts) const { LOG4CXX_INFO(logger_, "Gather Usage and Error Counts."); utils::dbms::SQLQuery query(db()); if (query.Prepare(sql_pt::kSelectAppLevels)) { @@ -566,7 +566,7 @@ bool SQLPTRepresentation::GatherUsageAndErrorCounts( } void SQLPTRepresentation::GatherDeviceData( - policy_table::DeviceData* data) const { + policy_table::DeviceData* data) const { LOG4CXX_INFO(logger_, "Gather device data."); data->mark_initialized(); @@ -581,7 +581,7 @@ void SQLPTRepresentation::GatherDeviceData( } bool SQLPTRepresentation::GatherFunctionalGroupings( - policy_table::FunctionalGroupings* groups) const { + policy_table::FunctionalGroupings* groups) const { LOG4CXX_INFO(logger_, "Gather Functional Groupings info"); utils::dbms::SQLQuery func_group(db()); if (!func_group.Prepare(sql_pt::kSelectFunctionalGroups)) { @@ -624,7 +624,7 @@ bool SQLPTRepresentation::GatherFunctionalGroupings( } bool SQLPTRepresentation::GatherConsumerFriendlyMessages( - policy_table::ConsumerFriendlyMessages* messages) const { + policy_table::ConsumerFriendlyMessages* messages) const { LOG4CXX_INFO(logger_, "Gather Consumer Friendly Messages"); utils::dbms::SQLQuery query(db()); if (!query.Prepare(sql_pt::kSelectUserMsgsVersion) || !query.Next()) { @@ -700,7 +700,8 @@ bool SQLPTRepresentation::Save(const policy_table::Table& table) { db_->RollbackTransaction(); return false; } - if (!SaveApplicationPoliciesSection(table.policy_table.app_policies_section)) { + if (!SaveApplicationPoliciesSection( + table.policy_table.app_policies_section)) { db_->RollbackTransaction(); return false; } @@ -709,7 +710,7 @@ bool SQLPTRepresentation::Save(const policy_table::Table& table) { return false; } if (!SaveConsumerFriendlyMessages( - *table.policy_table.consumer_friendly_messages)) { + *table.policy_table.consumer_friendly_messages)) { db_->RollbackTransaction(); return false; } @@ -731,7 +732,7 @@ bool SQLPTRepresentation::Save(const policy_table::Table& table) { } bool SQLPTRepresentation::SaveFunctionalGroupings( - const policy_table::FunctionalGroupings& groups) { + const policy_table::FunctionalGroupings& groups) { utils::dbms::SQLQuery query_delete(db()); if (!query_delete.Exec(sql_pt::kDeleteRpc)) { LOG4CXX_WARN(logger_, "Incorrect delete from rpc."); @@ -762,8 +763,9 @@ bool SQLPTRepresentation::SaveFunctionalGroupings( // to avoid ambiguity. query.Bind(0, static_cast<int64_t>(id)); query.Bind(1, it->first); - it->second.user_consent_prompt.is_initialized() ? - query.Bind(2, *(it->second.user_consent_prompt)) : query.Bind(2); + it->second.user_consent_prompt.is_initialized() + ? query.Bind(2, *(it->second.user_consent_prompt)) + : query.Bind(2); if (!query.Exec() || !query.Reset()) { LOG4CXX_WARN(logger_, "Incorrect insert into functional groups"); @@ -781,8 +783,8 @@ bool SQLPTRepresentation::SaveRpcs(int64_t group_id, const policy_table::Rpc& rpcs) { utils::dbms::SQLQuery query(db()); utils::dbms::SQLQuery query_parameter(db()); - if (!query.Prepare(sql_pt::kInsertRpc) - || !query_parameter.Prepare(sql_pt::kInsertRpcWithParameter)) { + if (!query.Prepare(sql_pt::kInsertRpc) || + !query_parameter.Prepare(sql_pt::kInsertRpcWithParameter)) { LOG4CXX_WARN(logger_, "Incorrect insert statement for rpc"); return false; } @@ -799,9 +801,9 @@ bool SQLPTRepresentation::SaveRpcs(int64_t group_id, for (ps_it = parameters.begin(); ps_it != parameters.end(); ++ps_it) { query_parameter.Bind(0, it->first); query_parameter.Bind( - 1, std::string(policy_table::EnumToJsonString(*hmi_it))); + 1, std::string(policy_table::EnumToJsonString(*hmi_it))); query_parameter.Bind( - 2, std::string(policy_table::EnumToJsonString(*ps_it))); + 2, std::string(policy_table::EnumToJsonString(*ps_it))); query_parameter.Bind(3, group_id); if (!query_parameter.Exec() || !query_parameter.Reset()) { LOG4CXX_WARN(logger_, "Incorrect insert into rpc with parameter"); @@ -880,17 +882,20 @@ bool SQLPTRepresentation::SaveSpecificAppPolicy( const policy_table::ApplicationPolicies::value_type& app) { utils::dbms::SQLQuery app_query(db()); if (!app_query.Prepare(sql_pt::kInsertApplication)) { - LOG4CXX_WARN(logger_, "Incorrect insert statement into application (device)."); + LOG4CXX_WARN(logger_, + "Incorrect insert statement into application (device)."); return false; } app_query.Bind(0, app.first); - app_query.Bind(1, std::string(policy_table::EnumToJsonString(app.second.priority))); + app_query.Bind( + 1, std::string(policy_table::EnumToJsonString(app.second.priority))); app_query.Bind(2, app.second.is_null()); app_query.Bind(3, *app.second.memory_kb); app_query.Bind(4, static_cast<int64_t>(*app.second.heart_beat_timeout_ms)); - app.second.certificate.is_initialized() ? - app_query.Bind(5, *app.second.certificate) : app_query.Bind(5); + app.second.certificate.is_initialized() + ? app_query.Bind(5, *app.second.certificate) + : app_query.Bind(5); if (!app_query.Exec() || !app_query.Reset()) { LOG4CXX_WARN(logger_, "Incorrect insert into application."); return false; @@ -932,7 +937,8 @@ bool policy::SQLPTRepresentation::SaveDevicePolicy( } app_query.Bind(0, kDeviceId); - app_query.Bind(1, std::string(policy_table::EnumToJsonString(device.priority))); + app_query.Bind(1, + std::string(policy_table::EnumToJsonString(device.priority))); app_query.Bind(2, false); app_query.Bind(3, 0); app_query.Bind(4, 0); @@ -947,7 +953,7 @@ bool policy::SQLPTRepresentation::SaveDevicePolicy( } bool SQLPTRepresentation::SaveAppGroup( - const std::string& app_id, const policy_table::Strings& app_groups) { + const std::string& app_id, const policy_table::Strings& app_groups) { utils::dbms::SQLQuery query(db()); if (!query.Prepare(sql_pt::kInsertAppGroup)) { LOG4CXX_WARN(logger_, "Incorrect insert statement for app group"); @@ -961,9 +967,9 @@ bool SQLPTRepresentation::SaveAppGroup( query.Bind(0, app_id); query.Bind(1, *it); if (!query.Exec() || !query.Reset()) { - LOG4CXX_WARN( - logger_, - "Incorrect insert into app group." << query.LastError().text()); + LOG4CXX_WARN(logger_, + "Incorrect insert into app group." + << query.LastError().text()); return false; } } @@ -1014,8 +1020,7 @@ bool SQLPTRepresentation::SaveAppType(const std::string& app_id, } bool SQLPTRepresentation::SaveRequestType( - const std::string& app_id, - const policy_table::RequestTypes& types) { + const std::string& app_id, const policy_table::RequestTypes& types) { utils::dbms::SQLQuery query(db()); if (!query.Prepare(sql_pt::kInsertRequestType)) { LOG4CXX_WARN(logger_, "Incorrect insert statement for request types."); @@ -1041,15 +1046,15 @@ bool SQLPTRepresentation::SaveModuleMeta(const policy_table::ModuleMeta& meta) { } bool SQLPTRepresentation::SaveModuleConfig( - const policy_table::ModuleConfig& config) { + const policy_table::ModuleConfig& config) { utils::dbms::SQLQuery query(db()); if (!query.Prepare(sql_pt::kUpdateModuleConfig)) { LOG4CXX_WARN(logger_, "Incorrect update statement for module config"); return false; } - bool is_preloaded = config.preloaded_pt.is_initialized() && - *config.preloaded_pt; + bool is_preloaded = + config.preloaded_pt.is_initialized() && *config.preloaded_pt; query.Bind(0, is_preloaded); query.Bind(1, config.exchange_after_x_ignition_cycles); @@ -1057,12 +1062,12 @@ bool SQLPTRepresentation::SaveModuleConfig( query.Bind(3, config.exchange_after_x_days); query.Bind(4, config.timeout_after_x_seconds); query.Bind(5, (*config.certificate)); - config.vehicle_make.is_initialized() ? - query.Bind(6, *(config.vehicle_make)) : query.Bind(6); - config.vehicle_model.is_initialized() ? - query.Bind(7, *(config.vehicle_model)) : query.Bind(7); - config.vehicle_year.is_initialized() ? - query.Bind(8, *(config.vehicle_year)) : query.Bind(8); + config.vehicle_make.is_initialized() ? query.Bind(6, *(config.vehicle_make)) + : query.Bind(6); + config.vehicle_model.is_initialized() ? query.Bind(7, *(config.vehicle_model)) + : query.Bind(7); + config.vehicle_year.is_initialized() ? query.Bind(8, *(config.vehicle_year)) + : query.Bind(8); if (!query.Exec()) { LOG4CXX_WARN(logger_, "Incorrect update module config"); @@ -1074,7 +1079,7 @@ bool SQLPTRepresentation::SaveModuleConfig( } if (!SaveNumberOfNotificationsPerMinute( - config.notifications_per_minute_by_priority)) { + config.notifications_per_minute_by_priority)) { return false; } @@ -1086,7 +1091,7 @@ bool SQLPTRepresentation::SaveModuleConfig( } bool SQLPTRepresentation::SaveServiceEndpoints( - const policy_table::ServiceEndpoints& endpoints) { + const policy_table::ServiceEndpoints& endpoints) { utils::dbms::SQLQuery query(db()); if (!query.Exec(sql_pt::kDeleteEndpoint)) { LOG4CXX_WARN(logger_, "Incorrect delete from endpoint."); @@ -1121,7 +1126,7 @@ bool SQLPTRepresentation::SaveServiceEndpoints( } bool SQLPTRepresentation::SaveConsumerFriendlyMessages( - const policy_table::ConsumerFriendlyMessages& messages) { + const policy_table::ConsumerFriendlyMessages& messages) { LOG4CXX_AUTO_TRACE(logger_); // According CRS-2419 If there is no “consumer_friendly_messages” key, @@ -1147,7 +1152,8 @@ bool SQLPTRepresentation::SaveConsumerFriendlyMessages( policy_table::Messages::const_iterator it; // TODO(IKozyrenko): Check logic if optional container is missing - for (it = messages.messages->begin(); it != messages.messages->end(); ++it) { + for (it = messages.messages->begin(); it != messages.messages->end(); + ++it) { if (!SaveMessageType(it->first)) { return false; } @@ -1202,14 +1208,15 @@ bool SQLPTRepresentation::SaveLanguage(const std::string& code) { } bool SQLPTRepresentation::SaveMessageString( - const std::string& type, const std::string& lang, - const policy_table::MessageString& strings) { + const std::string& type, + const std::string& lang, + const policy_table::MessageString& strings) { // Section is empty for SDL specific return true; } bool SQLPTRepresentation::SaveSecondsBetweenRetries( - const policy_table::SecondsBetweenRetries& seconds) { + const policy_table::SecondsBetweenRetries& seconds) { utils::dbms::SQLQuery query(db()); if (!query.Exec(sql_pt::kDeleteSecondsBetweenRetries)) { LOG4CXX_WARN(logger_, "Incorrect delete from seconds between retries."); @@ -1234,7 +1241,7 @@ bool SQLPTRepresentation::SaveSecondsBetweenRetries( } bool SQLPTRepresentation::SaveNumberOfNotificationsPerMinute( - const policy_table::NumberOfNotificationsPerMinute& notifications) { + const policy_table::NumberOfNotificationsPerMinute& notifications) { utils::dbms::SQLQuery query(db()); if (!query.Prepare(sql_pt::kInsertNotificationsByPriority)) { LOG4CXX_WARN(logger_, @@ -1256,7 +1263,7 @@ bool SQLPTRepresentation::SaveNumberOfNotificationsPerMinute( } bool SQLPTRepresentation::SaveDeviceData( - const policy_table::DeviceData& devices) { + const policy_table::DeviceData& devices) { utils::dbms::SQLQuery query(db()); if (!query.Prepare(sql_pt::kInsertDeviceData)) { LOG4CXX_WARN(logger_, "Incorrect insert statement for device data."); @@ -1276,7 +1283,7 @@ bool SQLPTRepresentation::SaveDeviceData( } bool SQLPTRepresentation::SaveUsageAndErrorCounts( - const policy_table::UsageAndErrorCounts& counts) { + const policy_table::UsageAndErrorCounts& counts) { const_cast<policy_table::UsageAndErrorCounts&>(counts).mark_initialized(); utils::dbms::SQLQuery query(db()); if (!query.Exec(sql_pt::kDeleteAppLevel)) { @@ -1332,8 +1339,8 @@ void SQLPTRepresentation::SaveUpdateRequired(bool value) { if (!query.Prepare(/*sql_pt::kUpdateFlagUpdateRequired*/ "UPDATE `module_meta` SET `flag_update_required` = ?")) { LOG4CXX_WARN(logger_, - "Incorrect update into module meta (update_required): " << - strerror(errno)); + "Incorrect update into module meta (update_required): " + << strerror(errno)); return; } query.Bind(0, value); @@ -1343,8 +1350,8 @@ void SQLPTRepresentation::SaveUpdateRequired(bool value) { } bool SQLPTRepresentation::GetInitialAppData(const std::string& app_id, - StringArray* nicknames, - StringArray* app_types) { + StringArray* nicknames, + StringArray* app_types) { LOG4CXX_INFO(logger_, "Getting initial application data."); utils::dbms::SQLQuery app_names(db()); if (!app_names.Prepare(sql_pt::kSelectNicknames)) { @@ -1370,13 +1377,13 @@ bool SQLPTRepresentation::GetInitialAppData(const std::string& app_id, } bool SQLPTRepresentation::GetFunctionalGroupings( - policy_table::FunctionalGroupings& groups) { + policy_table::FunctionalGroupings& groups) { LOG4CXX_AUTO_TRACE(logger_); return GatherFunctionalGroupings(&groups); } bool SQLPTRepresentation::GatherAppType( - const std::string& app_id, policy_table::AppHMITypes* app_types) const { + const std::string& app_id, policy_table::AppHMITypes* app_types) const { utils::dbms::SQLQuery query(db()); if (!query.Prepare(sql_pt::kSelectAppTypes)) { LOG4CXX_WARN(logger_, "Incorrect select from app types"); @@ -1415,7 +1422,7 @@ bool SQLPTRepresentation::GatherRequestType( } bool SQLPTRepresentation::GatherNickName( - const std::string& app_id, policy_table::Strings* nicknames) const { + const std::string& app_id, policy_table::Strings* nicknames) const { utils::dbms::SQLQuery query(db()); if (!query.Prepare(sql_pt::kSelectNicknames)) { LOG4CXX_WARN(logger_, "Incorrect select from app nicknames"); @@ -1430,7 +1437,7 @@ bool SQLPTRepresentation::GatherNickName( } bool SQLPTRepresentation::GatherAppGroup( - const std::string& app_id, policy_table::Strings* app_groups) const { + const std::string& app_id, policy_table::Strings* app_groups) const { utils::dbms::SQLQuery query(db()); if (!query.Prepare(sql_pt::kSelectAppGroups)) { LOG4CXX_WARN(logger_, "Incorrect select from app groups"); @@ -1469,7 +1476,6 @@ bool SQLPTRepresentation::SaveApplicationCustomData(const std::string& app_id, bool SQLPTRepresentation::IsApplicationRevoked( const std::string& app_id) const { - utils::dbms::SQLQuery query(db()); if (!query.Prepare(sql_pt::kSelectApplicationRevoked)) { LOG4CXX_WARN(logger_, "Incorrect select from is_revoked of application"); @@ -1482,9 +1488,9 @@ bool SQLPTRepresentation::IsApplicationRevoked( return false; } return query.IsNull(0) ? false : query.GetBoolean(0); - } +} bool SQLPTRepresentation::IsApplicationRepresented( - const std::string& app_id) const { + const std::string& app_id) const { utils::dbms::SQLQuery query(db()); if (!query.Prepare(sql_pt::kSelectApplicationRepresented)) { LOG4CXX_WARN(logger_, "Incorrect select application by id"); @@ -1570,15 +1576,17 @@ bool SQLPTRepresentation::IsDBVersionActual() const { LOG4CXX_AUTO_TRACE(logger_); utils::dbms::SQLQuery query(db()); if (!query.Prepare(sql_pt::kSelectDBVersion) || !query.Exec()) { - LOG4CXX_ERROR(logger_, "Failed to get DB version: " - << query.LastError().text()); + LOG4CXX_ERROR(logger_, + "Failed to get DB version: " << query.LastError().text()); return false; } const int32_t saved_db_version = query.GetInteger(0); const int32_t current_db_version = GetDBVersion(); - LOG4CXX_DEBUG(logger_, "Saved DB version is: " << saved_db_version - << ". Current DB vesion is: " << current_db_version); + LOG4CXX_DEBUG(logger_, + "Saved DB version is: " << saved_db_version + << ". Current DB vesion is: " + << current_db_version); return current_db_version == saved_db_version; } @@ -1587,8 +1595,8 @@ bool SQLPTRepresentation::UpdateDBVersion() const { LOG4CXX_AUTO_TRACE(logger_); utils::dbms::SQLQuery query(db()); if (!query.Prepare(sql_pt::kUpdateDBVersion)) { - LOG4CXX_ERROR(logger_, "Incorrect DB version query: " - << query.LastError().text()); + LOG4CXX_ERROR(logger_, + "Incorrect DB version query: " << query.LastError().text()); return false; } @@ -1597,8 +1605,8 @@ bool SQLPTRepresentation::UpdateDBVersion() const { query.Bind(0, db_version); if (!query.Exec()) { - LOG4CXX_ERROR(logger_, "DB version getting failed: " - << query.LastError().text()); + LOG4CXX_ERROR(logger_, + "DB version getting failed: " << query.LastError().text()); return false; } @@ -1642,10 +1650,8 @@ bool SQLPTRepresentation::CopyApplication(const std::string& source, : query.Bind(1, source_app.GetBoolean(0)); source_app.IsNull(1) ? query.Bind(2) : query.Bind(2, source_app.GetBoolean(1)); - source_app.IsNull(2) ? query.Bind(3) - : query.Bind(3, source_app.GetString(2)); - source_app.IsNull(3) ? query.Bind(4) - : query.Bind(4, source_app.GetString(3)); + source_app.IsNull(2) ? query.Bind(3) : query.Bind(3, source_app.GetString(2)); + source_app.IsNull(3) ? query.Bind(4) : query.Bind(4, source_app.GetString(3)); source_app.IsNull(4) ? query.Bind(5) : query.Bind(5, source_app.GetBoolean(4)); source_app.IsNull(5) ? query.Bind(6) diff --git a/src/components/policy/test/counter_test.cc b/src/components/policy/test/counter_test.cc index d0de8a2875..7efe88419e 100644 --- a/src/components/policy/test/counter_test.cc +++ b/src/components/policy/test/counter_test.cc @@ -49,7 +49,9 @@ using namespace usage_statistics; // C - Input data // D - Expected result -TEST(StatisticsManagerIncrementMethod1Arg, GlobalCounterOverloadedIncrement_CallONCE_StatisticsManagerIncrementCalledONCE) { +TEST( + StatisticsManagerIncrementMethod1Arg, + GlobalCounterOverloadedIncrement_CallONCE_StatisticsManagerIncrementCalledONCE) { // Arrange MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>(); GlobalCounter reboots_counter(msm, SYNC_REBOOTS); @@ -61,7 +63,9 @@ TEST(StatisticsManagerIncrementMethod1Arg, GlobalCounterOverloadedIncrement_Call ++reboots_counter; } -TEST(StatisticsManagerIncrementMethod1Arg, GlobalCounterOverloadedIncrement_CallTWICE_StatisticsManagerIncrementCalledTWICE) { +TEST( + StatisticsManagerIncrementMethod1Arg, + GlobalCounterOverloadedIncrement_CallTWICE_StatisticsManagerIncrementCalledTWICE) { // Arrange MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>(); GlobalCounter reboots_counter(msm, SYNC_REBOOTS); @@ -74,7 +78,9 @@ TEST(StatisticsManagerIncrementMethod1Arg, GlobalCounterOverloadedIncrement_Call ++reboots_counter; } -TEST(StatisticsManagerIncrementMethod2Args, AppCounterOverloadedIncrement_CallONCE_StatisticsManagerIncrementCalledONCE) { +TEST( + StatisticsManagerIncrementMethod2Args, + AppCounterOverloadedIncrement_CallONCE_StatisticsManagerIncrementCalledONCE) { // Arrange MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>(); AppCounter user_selections_counter(msm, "HelloApp", USER_SELECTIONS); @@ -86,7 +92,9 @@ TEST(StatisticsManagerIncrementMethod2Args, AppCounterOverloadedIncrement_CallON ++user_selections_counter; } -TEST(StatisticsManagerIncrementMethod2Args, AppCounterOverloadedIncrement_CallTWICE_StatisticsManagerIncrementCalledTWICE) { +TEST( + StatisticsManagerIncrementMethod2Args, + AppCounterOverloadedIncrement_CallTWICE_StatisticsManagerIncrementCalledTWICE) { // Arrange MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>(); AppCounter user_selections_counter(msm, "HelloApp", USER_SELECTIONS); @@ -99,7 +107,8 @@ TEST(StatisticsManagerIncrementMethod2Args, AppCounterOverloadedIncrement_CallTW ++user_selections_counter; } //--- -TEST(StatisticsManagerSetMethod, AppInfoUpdateMethod_CallONCE_StatisticsManagerSetMethodCalledONCE) { +TEST(StatisticsManagerSetMethod, + AppInfoUpdateMethod_CallONCE_StatisticsManagerSetMethodCalledONCE) { // Arrange MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>(); AppInfo gui_language_info(msm, "HelloApp", LANGUAGE_GUI); @@ -111,7 +120,8 @@ TEST(StatisticsManagerSetMethod, AppInfoUpdateMethod_CallONCE_StatisticsManagerS gui_language_info.Update("Klingon"); } -TEST(StatisticsManagerSetMethod, AppInfoUpdateMethod_CallTWICE_StatisticsManagerSetMethodCalledTWICE) { +TEST(StatisticsManagerSetMethod, + AppInfoUpdateMethod_CallTWICE_StatisticsManagerSetMethodCalledTWICE) { // Arrange MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>(); AppInfo gui_language_info(msm, "HelloApp", LANGUAGE_GUI); @@ -125,8 +135,8 @@ TEST(StatisticsManagerSetMethod, AppInfoUpdateMethod_CallTWICE_StatisticsManager gui_language_info.Update("UA"); } - -TEST(StatisticsManagerAddMethod, AppStopwatchStartMethod_CallONCE_StatisticsManagerAddMethodCalledONCE) { +TEST(StatisticsManagerAddMethod, + AppStopwatchStartMethod_CallONCE_StatisticsManagerAddMethodCalledONCE) { // Arrange MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>(); const std::uint32_t time_out = 1; @@ -142,7 +152,8 @@ TEST(StatisticsManagerAddMethod, AppStopwatchStartMethod_CallONCE_StatisticsMana // Tests disabled due to uncorrect behavior of timer. // Will be undisabled after fix. -TEST(StatisticsManagerAddMethod, DISABLED_AppStopwatchSwitchMethod_Call_StatisticsManagerAddMethodCalled) { +TEST(StatisticsManagerAddMethod, + DISABLED_AppStopwatchSwitchMethod_Call_StatisticsManagerAddMethodCalled) { // Arrange MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>(); AppStopwatchImpl hmi_full_stopwatch(msm, "HelloApp"); @@ -154,10 +165,11 @@ TEST(StatisticsManagerAddMethod, DISABLED_AppStopwatchSwitchMethod_Call_Statisti // Act hmi_full_stopwatch.WriteTime(); - } -TEST(StatisticsManagerAddMethod, DISABLED_AppStopwatchSwitchMethod_CallAnd1SecSleepAfter_StatisticsManagerAddMethodCalledWith1SecTimespan) { +TEST( + StatisticsManagerAddMethod, + DISABLED_AppStopwatchSwitchMethod_CallAnd1SecSleepAfter_StatisticsManagerAddMethodCalledWith1SecTimespan) { // Arrange MockStatisticsManager* msm = new StrictMock<MockStatisticsManager>(); const std::uint32_t time_out = 1; diff --git a/src/components/policy/test/policy_manager_impl_test.cc b/src/components/policy/test/policy_manager_impl_test.cc index ed7d71fb16..c1239d9f47 100644 --- a/src/components/policy/test/policy_manager_impl_test.cc +++ b/src/components/policy/test/policy_manager_impl_test.cc @@ -116,14 +116,14 @@ class PolicyManagerImplTest : public ::testing::Test { } ::testing::AssertionResult IsValid(const policy_table::Table& table) { - if (table.is_valid()) { - return ::testing::AssertionSuccess(); - } else { - ::rpc::ValidationReport report(" - table"); - table.ReportErrors(&report); - return ::testing::AssertionFailure() << ::rpc::PrettyFormat(report); - } - } + if (table.is_valid()) { + return ::testing::AssertionSuccess(); + } else { + ::rpc::ValidationReport report(" - table"); + table.ReportErrors(&report); + return ::testing::AssertionFailure() << ::rpc::PrettyFormat(report); + } + } }; class PolicyManagerImplTest2 : public ::testing::Test { @@ -155,7 +155,8 @@ class PolicyManagerImplTest2 : public ::testing::Test { file_system::DeleteFile("policy.sqlite"); manager = new PolicyManagerImpl(); - ON_CALL(policy_settings_, app_storage_folder()).WillByDefault(ReturnRef(kAppStorageFolder)); + ON_CALL(policy_settings_, app_storage_folder()) + .WillByDefault(ReturnRef(kAppStorageFolder)); manager->set_listener(&listener); const char* levels[] = {"BACKGROUND", "FULL", "LIMITED", "NONE"}; hmi_level.assign(levels, levels + sizeof(levels) / sizeof(levels[0])); @@ -190,7 +191,8 @@ class PolicyManagerImplTest2 : public ::testing::Test { void CreateLocalPT(const std::string& file_name) { file_system::remove_directory_content("storage1"); - ON_CALL(policy_settings_, app_storage_folder()).WillByDefault(ReturnRef(kAppStorageFolder)); + ON_CALL(policy_settings_, app_storage_folder()) + .WillByDefault(ReturnRef(kAppStorageFolder)); ASSERT_TRUE(manager->InitPT(file_name, &policy_settings_)); } @@ -317,89 +319,89 @@ class PolicyManagerImplTest2 : public ::testing::Test { Json::Value CreatePTforLoad() { const std::string load_table( - "{" - "\"policy_table\": {" + "{" + "\"policy_table\": {" "\"module_config\": {" - "\"preloaded_pt\": true," - "\"exchange_after_x_ignition_cycles\": 10," - "\"exchange_after_x_kilometers\": 100," - "\"exchange_after_x_days\": 5," - "\"timeout_after_x_seconds\": 500," - "\"seconds_between_retries\": [10, 20, 30]," - "\"endpoints\": {" - "\"0x00\": {" - "\"default\": [\"http://ford.com/cloud/default\"]" - "}" - "}," - "\"notifications_per_minute_by_priority\": {" - "\"emergency\": 1," - "\"navigation\": 2," - "\"VOICECOMM\": 3," - "\"communication\": 4," - "\"normal\": 5," - "\"none\": 6" - "}," - "\"vehicle_make\" : \"MakeT\"," - "\"vehicle_model\" : \"ModelT\"," - "\"vehicle_year\": \"2014\"" - "}," + "\"preloaded_pt\": true," + "\"exchange_after_x_ignition_cycles\": 10," + "\"exchange_after_x_kilometers\": 100," + "\"exchange_after_x_days\": 5," + "\"timeout_after_x_seconds\": 500," + "\"seconds_between_retries\": [10, 20, 30]," + "\"endpoints\": {" + "\"0x00\": {" + "\"default\": [\"http://ford.com/cloud/default\"]" + "}" + "}," + "\"notifications_per_minute_by_priority\": {" + "\"emergency\": 1," + "\"navigation\": 2," + "\"VOICECOMM\": 3," + "\"communication\": 4," + "\"normal\": 5," + "\"none\": 6" + "}," + "\"vehicle_make\" : \"MakeT\"," + "\"vehicle_model\" : \"ModelT\"," + "\"vehicle_year\": \"2014\"" + "}," "\"app_policies\": {" - "\"default\": {" - "\"memory_kb\": 50," - "\"heart_beat_timeout_ms\": 100," - "\"groups\": [\"default\"]," - "\"keep_context\": true," - "\"steal_focus\": true," - "\"priority\": \"EMERGENCY\"," - "\"default_hmi\": \"FULL\"," - "\"certificate\": \"sign\"" - "}, " - "\"pre_DataConsent\": {" - "\"memory_kb\": 50," - "\"heart_beat_timeout_ms\": 100," - "\"groups\": [\"default\"]," - "\"keep_context\": true," - "\"steal_focus\": true," - "\"priority\": \"EMERGENCY\"," - "\"default_hmi\": \"FULL\"," - "\"certificate\": \"sign\"" - "}, " - "\"device\": {" - "\"memory_kb\": 50," - "\"heart_beat_timeout_ms\": 100," - "\"groups\": [\"default\"]," - "\"keep_context\": true," - "\"steal_focus\": true," - "\"priority\": \"EMERGENCY\"," - "\"default_hmi\": \"FULL\"," - "\"certificate\": \"sign\"" - "}," - "\"1234\": {" - "\"memory_kb\": 50," - "\"heart_beat_timeout_ms\": 100," - "\"groups\": [\"default\"]," - "\"keep_context\": true," - "\"steal_focus\": true," - "\"priority\": \"EMERGENCY\"," - "\"default_hmi\": \"FULL\"," - "\"certificate\": \"sign\"" - "}" - "}," + "\"default\": {" + "\"memory_kb\": 50," + "\"heart_beat_timeout_ms\": 100," + "\"groups\": [\"default\"]," + "\"keep_context\": true," + "\"steal_focus\": true," + "\"priority\": \"EMERGENCY\"," + "\"default_hmi\": \"FULL\"," + "\"certificate\": \"sign\"" + "}, " + "\"pre_DataConsent\": {" + "\"memory_kb\": 50," + "\"heart_beat_timeout_ms\": 100," + "\"groups\": [\"default\"]," + "\"keep_context\": true," + "\"steal_focus\": true," + "\"priority\": \"EMERGENCY\"," + "\"default_hmi\": \"FULL\"," + "\"certificate\": \"sign\"" + "}, " + "\"device\": {" + "\"memory_kb\": 50," + "\"heart_beat_timeout_ms\": 100," + "\"groups\": [\"default\"]," + "\"keep_context\": true," + "\"steal_focus\": true," + "\"priority\": \"EMERGENCY\"," + "\"default_hmi\": \"FULL\"," + "\"certificate\": \"sign\"" + "}," + "\"1234\": {" + "\"memory_kb\": 50," + "\"heart_beat_timeout_ms\": 100," + "\"groups\": [\"default\"]," + "\"keep_context\": true," + "\"steal_focus\": true," + "\"priority\": \"EMERGENCY\"," + "\"default_hmi\": \"FULL\"," + "\"certificate\": \"sign\"" + "}" + "}," "\"consumer_friendly_messages\": {" - "\"version\": \"1.2\"" - "}," + "\"version\": \"1.2\"" + "}," "\"functional_groupings\": {" - "\"default\": {" - "\"rpcs\": {" - "\"Update\": {" - "\"hmi_levels\": [\"FULL\"]," - "\"parameters\" : [\"speed\"]" - "}" - "}" - "}" + "\"default\": {" + "\"rpcs\": {" + "\"Update\": {" + "\"hmi_levels\": [\"FULL\"]," + "\"parameters\" : [\"speed\"]" + "}" "}" - "}" - "}"); + "}" + "}" + "}" + "}"); Json::Value table(Json::objectValue); Json::Reader reader; EXPECT_TRUE(reader.parse(load_table, table)); @@ -416,7 +418,7 @@ TEST_F(PolicyManagerImplTest, GetNotificationsNumber) { } TEST_F(PolicyManagerImplTest2, GetNotificationsNumberAfterPTUpdate) { - // Arrange + // Arrange Json::Value table = CreatePTforLoad(); policy_table::Table update(&table); update.SetPolicyTableType(rpc::policy_table_interface_base::PT_UPDATE); diff --git a/src/components/policy/test/sql_pt_representation_test.cc b/src/components/policy/test/sql_pt_representation_test.cc index 3fa56d8eb8..08c0e65584 100644 --- a/src/components/policy/test/sql_pt_representation_test.cc +++ b/src/components/policy/test/sql_pt_representation_test.cc @@ -76,8 +76,9 @@ class SQLPTRepresentationTest : public SQLPTRepresentation, static DBMS* dbms; static SQLPTRepresentation* reps; static const std::string kDatabaseName; - //Gtest can show message that this object doesn't destroyed - static std::auto_ptr<policy_handler_test::MockPolicySettings> policy_settings_; + // Gtest can show message that this object doesn't destroyed + static std::auto_ptr<policy_handler_test::MockPolicySettings> + policy_settings_; static void SetUpTestCase() { const std::string kAppStorageFolder = "storage1"; @@ -86,14 +87,16 @@ class SQLPTRepresentationTest : public SQLPTRepresentation, reps = new SQLPTRepresentation; dbms = new DBMS(kDatabaseName); policy_settings_ = std::auto_ptr<policy_handler_test::MockPolicySettings>( - new policy_handler_test::MockPolicySettings()); - ON_CALL(*policy_settings_, - app_storage_folder()).WillByDefault(ReturnRef(kAppStorageFolder)); + new policy_handler_test::MockPolicySettings()); + ON_CALL(*policy_settings_, app_storage_folder()) + .WillByDefault(ReturnRef(kAppStorageFolder)); EXPECT_EQ(::policy::SUCCESS, reps->Init(policy_settings_.get())); EXPECT_TRUE(dbms->Open()); } - void TearDown() OVERRIDE { EXPECT_TRUE(reps->Clear()); } + void TearDown() OVERRIDE { + EXPECT_TRUE(reps->Clear()); + } static void TearDownTestCase() { EXPECT_TRUE(reps->Drop()); @@ -104,7 +107,9 @@ class SQLPTRepresentationTest : public SQLPTRepresentation, policy_settings_.reset(); } - virtual utils::dbms::SQLDatabase* db() const { return reps->db(); } + virtual utils::dbms::SQLDatabase* db() const { + return reps->db(); + } void GatherModuleMeta(policy_table::ModuleMeta* meta) const { ::SQLPTRepresentation::GatherModuleMeta(meta); @@ -153,9 +158,12 @@ class SQLPTRepresentationTest : public SQLPTRepresentation, } void CheckAppPoliciesSection( - policy_table::ApplicationPoliciesSection& policies, uint16_t apps_size, - policy_table::Priority prio, const std::string& section, - uint16_t memory_kb, uint32_t heart_beat_timeout_ms, + policy_table::ApplicationPoliciesSection& policies, + uint16_t apps_size, + policy_table::Priority prio, + const std::string& section, + uint16_t memory_kb, + uint32_t heart_beat_timeout_ms, policy_table::Strings& groups) const { if (section != "device") { policy_table::ApplicationPolicies& apps = policies.apps; @@ -327,21 +335,25 @@ std::auto_ptr<policy_handler_test::MockPolicySettings> class SQLPTRepresentationTest2 : public ::testing::Test { protected: - SQLPTRepresentationTest2() : kAppStorageFolder("storage123") - , kOpenAttemptTimeoutMs(700u) - , kAttemptsToOpenPolicyDB(8u) {} + SQLPTRepresentationTest2() + : kAppStorageFolder("storage123") + , kOpenAttemptTimeoutMs(700u) + , kAttemptsToOpenPolicyDB(8u) {} void SetUp() OVERRIDE { file_system::CreateDirectory(kAppStorageFolder); chmod(kAppStorageFolder.c_str(), 00000); - ON_CALL(policy_settings_, app_storage_folder()).WillByDefault(ReturnRef(kAppStorageFolder)); - ON_CALL(policy_settings_, open_attempt_timeout_ms()).WillByDefault(Return(kOpenAttemptTimeoutMs)); - ON_CALL(policy_settings_, attempts_to_open_policy_db()).WillByDefault(Return(kAttemptsToOpenPolicyDB)); + ON_CALL(policy_settings_, app_storage_folder()) + .WillByDefault(ReturnRef(kAppStorageFolder)); + ON_CALL(policy_settings_, open_attempt_timeout_ms()) + .WillByDefault(Return(kOpenAttemptTimeoutMs)); + ON_CALL(policy_settings_, attempts_to_open_policy_db()) + .WillByDefault(Return(kAttemptsToOpenPolicyDB)); reps = new SQLPTRepresentation; } void TearDown() OVERRIDE { - file_system::RemoveDirectory(kAppStorageFolder,true); + file_system::RemoveDirectory(kAppStorageFolder, true); delete reps; } @@ -357,8 +369,7 @@ TEST_F(SQLPTRepresentationTest2, DISABLED_OpenAttemptTimeOut_ExpectCorrectNumber) { EXPECT_EQ(::policy::FAIL, reps->Init(&policy_settings_)); // Check Actual attempts number made to try to open DB - EXPECT_EQ(kAttemptsToOpenPolicyDB, - reps->open_counter()); + EXPECT_EQ(kAttemptsToOpenPolicyDB, reps->open_counter()); // Check timeot value correctly read from config file. EXPECT_EQ(700u, kOpenAttemptTimeoutMs); } @@ -969,8 +980,8 @@ TEST(SQLPTRepresentationTest3, Init_InitNewDataBase_ExpectResultSuccess) { SQLPTRepresentation* reps; reps = new SQLPTRepresentation; // Checks - ON_CALL(policy_settings_, - app_storage_folder()).WillByDefault(ReturnRef(kAppStorageFolder)); + ON_CALL(policy_settings_, app_storage_folder()) + .WillByDefault(ReturnRef(kAppStorageFolder)); EXPECT_EQ(::policy::SUCCESS, reps->Init(&policy_settings_)); EXPECT_EQ(::policy::EXISTS, reps->Init(&policy_settings_)); reps->RemoveDB(); @@ -1138,10 +1149,12 @@ TEST_F( const policy_table::HmiLevels& hmi_levels1 = rpc_it->second.hmi_levels; EXPECT_EQ(3u, hmi_levels1.size()); EXPECT_TRUE(hmi_levels1.end() != - std::find(hmi_levels1.begin(), hmi_levels1.end(), + std::find(hmi_levels1.begin(), + hmi_levels1.end(), policy_table::HmiLevel::HL_BACKGROUND)); EXPECT_TRUE(hmi_levels1.end() != - std::find(hmi_levels1.begin(), hmi_levels1.end(), + std::find(hmi_levels1.begin(), + hmi_levels1.end(), policy_table::HmiLevel::HL_LIMITED)); EXPECT_TRUE(hmi_levels1.end() != std::find(hmi_levels1.begin(), hmi_levels1.end(), @@ -1412,7 +1425,7 @@ TEST_F(SQLPTRepresentationTest, TEST(SQLPTRepresentationTest3, RemoveDB_RemoveDB_ExpectFileDeleted) { // Arrange policy_handler_test::MockPolicySettings policy_settings_; - SQLPTRepresentation* reps = new SQLPTRepresentation; + SQLPTRepresentation* reps = new SQLPTRepresentation; EXPECT_EQ(::policy::SUCCESS, reps->Init(&policy_settings_)); EXPECT_EQ(::policy::EXISTS, reps->Init(&policy_settings_)); std::string path = (reps->db())->get_path(); @@ -1433,7 +1446,7 @@ TEST_F(SQLPTRepresentationTest, update.SetPolicyTableType(rpc::policy_table_interface_base::PT_UPDATE); // Assert - //ASSERT_TRUE(IsValid(update)); + // ASSERT_TRUE(IsValid(update)); ASSERT_TRUE(reps->Save(update)); // Act @@ -1513,7 +1526,7 @@ TEST_F(SQLPTRepresentationTest, Save_SetPolicyTableThenSave_ExpectSavedToPT) { policy_table::UsageAndErrorCounts counts; GatherUsageAndErrorCounts(&counts); EXPECT_EQ(0u, counts.app_level->size()); - //ASSERT_TRUE(IsValid(update)); + // ASSERT_TRUE(IsValid(update)); // Act ASSERT_TRUE(reps->Save(update)); @@ -1548,17 +1561,33 @@ TEST_F(SQLPTRepresentationTest, Save_SetPolicyTableThenSave_ExpectSavedToPT) { rpc::String<1ul, 255ul> str("default"); policy_table::Strings groups; groups.push_back(str); - CheckAppPoliciesSection(policies, apps_size, - policy_table::Priority::P_EMERGENCY, "1234", 150u, - 200u, groups); - CheckAppPoliciesSection(policies, apps_size, - policy_table::Priority::P_EMERGENCY, "default", 50u, - 100u, groups); - CheckAppPoliciesSection(policies, apps_size, + CheckAppPoliciesSection(policies, + apps_size, + policy_table::Priority::P_EMERGENCY, + "1234", + 150u, + 200u, + groups); + CheckAppPoliciesSection(policies, + apps_size, + policy_table::Priority::P_EMERGENCY, + "default", + 50u, + 100u, + groups); + CheckAppPoliciesSection(policies, + apps_size, + policy_table::Priority::P_EMERGENCY, + "pre_DataConsent", + 40u, + 90u, + groups); + CheckAppPoliciesSection(policies, + apps_size, policy_table::Priority::P_EMERGENCY, - "pre_DataConsent", 40u, 90u, groups); - CheckAppPoliciesSection(policies, apps_size, - policy_table::Priority::P_EMERGENCY, "device", 0u, 0u, + "device", + 0u, + 0u, groups); CheckAppGroups("1234", groups); diff --git a/src/components/policy/test/update_status_manager_test.cc b/src/components/policy/test/update_status_manager_test.cc index 2c948ae207..623cb974d8 100644 --- a/src/components/policy/test/update_status_manager_test.cc +++ b/src/components/policy/test/update_status_manager_test.cc @@ -52,9 +52,13 @@ class UpdateStatusManagerTest : public ::testing::Test { public: UpdateStatusManagerTest() : k_timeout_(1) {} - void SetUp() { manager_ = new UpdateStatusManager(); } + void SetUp() { + manager_ = new UpdateStatusManager(); + } - void TearDown() OVERRIDE { delete manager_; } + void TearDown() OVERRIDE { + delete manager_; + } }; TEST_F(UpdateStatusManagerTest, diff --git a/src/components/resumption/test/last_state_test.cc b/src/components/resumption/test/last_state_test.cc index 7e4d1376c9..78acc68c90 100644 --- a/src/components/resumption/test/last_state_test.cc +++ b/src/components/resumption/test/last_state_test.cc @@ -49,9 +49,9 @@ const std::string kAppInfoStorageFile = "app_info_storage"; class LastStateTest : public ::testing::Test { protected: LastStateTest() - : empty_dictionary_("null\n") - , app_info_dat_file_("app_info.dat") - , last_state_(kAppStorageFolder, kAppInfoStorageFile){} + : empty_dictionary_("null\n") + , app_info_dat_file_("app_info.dat") + , last_state_(kAppStorageFolder, kAppInfoStorageFile) {} static void SetUpTestCase() { file_system::DeleteFile(kAppInfoStorageFile); @@ -80,14 +80,16 @@ TEST_F(LastStateTest, Basic) { TEST_F(LastStateTest, SetGetData) { { const Value& dictionary = last_state_.dictionary; - const Value& bluetooth_info = dictionary["TransportManager"]["BluetoothAdapter"]; + const Value& bluetooth_info = + dictionary["TransportManager"]["BluetoothAdapter"]; EXPECT_EQ(empty_dictionary_, bluetooth_info.toStyledString()); const Value& tcp_adapter_info = dictionary["TransportManager"]["TcpAdapter"]["devices"]; EXPECT_EQ(empty_dictionary_, tcp_adapter_info.toStyledString()); - const Value& resumption_time = dictionary["resumption"]["last_ign_off_time"]; + const Value& resumption_time = + dictionary["resumption"]["last_ign_off_time"]; EXPECT_EQ("null\n", resumption_time.toStyledString()); const Value& resumption_list = dictionary["resumption"]["resume_app_list"]; @@ -96,17 +98,17 @@ TEST_F(LastStateTest, SetGetData) { Value test_value; test_value["name"] = "test_device"; - last_state_ - .dictionary["TransportManager"]["TcpAdapter"]["devices"] = test_value; - last_state_ - .dictionary["TransportManager"]["BluetoothAdapter"]["devices"] = + last_state_.dictionary["TransportManager"]["TcpAdapter"]["devices"] = + test_value; + last_state_.dictionary["TransportManager"]["BluetoothAdapter"]["devices"] = "bluetooth_device"; last_state_.SaveToFileSystem(); } const Value& dictionary = last_state_.dictionary; - const Value& bluetooth_info = dictionary["TransportManager"]["BluetoothAdapter"]; + const Value& bluetooth_info = + dictionary["TransportManager"]["BluetoothAdapter"]; const Value& tcp_adapter_info = dictionary["TransportManager"]["TcpAdapter"]; EXPECT_EQ("{\n \"devices\" : \"bluetooth_device\"\n}\n", bluetooth_info.toStyledString()); diff --git a/src/components/security_manager/include/security_manager/crypto_manager_settings_impl.h b/src/components/security_manager/include/security_manager/crypto_manager_settings_impl.h index 727a49dcd4..1e4699b77a 100644 --- a/src/components/security_manager/include/security_manager/crypto_manager_settings_impl.h +++ b/src/components/security_manager/include/security_manager/crypto_manager_settings_impl.h @@ -34,8 +34,8 @@ class CryptoManagerSettingsImpl : public CryptoManagerSettings { return security_manager::SSLv3; } LOG4CXX_ERROR( - logger_, - "Unknown protocol: " << profile_.security_manager_protocol_name()); + logger_, + "Unknown protocol: " << profile_.security_manager_protocol_name()); return static_cast<security_manager::Protocol>(-1); } bool verify_peer() const OVERRIDE { diff --git a/src/components/security_manager/test/ssl_context_test.cc b/src/components/security_manager/test/ssl_context_test.cc index 1f4db577ce..5f27d2c9fd 100644 --- a/src/components/security_manager/test/ssl_context_test.cc +++ b/src/components/security_manager/test/ssl_context_test.cc @@ -95,7 +95,8 @@ class SSLTest : public testing::Test { } certificate_file.close(); certificate_data_base64_ = certificate.str(); - ASSERT_FALSE(certificate_data_base64_.empty()) << "Certificate data file is empty"; + ASSERT_FALSE(certificate_data_base64_.empty()) + << "Certificate data file is empty"; } virtual void SetUp() OVERRIDE { @@ -210,7 +211,7 @@ class SSLTestParam : public testing::TestWithParam<ProtocolAndCipher> { mock_crypto_manager_settings_ = utils::MakeShared< NiceMock<security_manager_test::MockCryptoManagerSettings>>(); utils::SharedPtr<security_manager::CryptoManagerSettings> server_crypto( - mock_crypto_manager_settings_); + mock_crypto_manager_settings_); crypto_manager = new security_manager::CryptoManagerImpl(server_crypto); SetServerInitialValues(GetParam().server_protocol, @@ -223,7 +224,7 @@ class SSLTestParam : public testing::TestWithParam<ProtocolAndCipher> { NiceMock<security_manager_test::MockCryptoManagerSettings>>(); utils::SharedPtr<security_manager::CryptoManagerSettings> client_crypto( - mock_client_manager_settings_); + mock_client_manager_settings_); client_manager = new security_manager::CryptoManagerImpl(client_crypto); SetClientInitialValues(GetParam().client_protocol, diff --git a/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_transport_adapter.h b/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_transport_adapter.h index a0929244d5..82e85bac70 100644 --- a/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_transport_adapter.h +++ b/src/components/transport_manager/include/transport_manager/bluetooth/bluetooth_transport_adapter.h @@ -49,15 +49,15 @@ class BluetoothTransportAdapter : public TransportAdapterImpl { /** * @brief Constructor. */ - BluetoothTransportAdapter(resumption::LastState& last_state, - const TransportManagerSettings& settings); + BluetoothTransportAdapter(resumption::LastState& last_state, + const TransportManagerSettings& settings); /** * @brief Destructor. */ virtual ~BluetoothTransportAdapter(); - protected: + protected: /** * @brief Return type of device. */ diff --git a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h index 6301b82f20..129a0aee36 100644 --- a/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h +++ b/src/components/transport_manager/include/transport_manager/transport_adapter/transport_adapter_impl.h @@ -176,9 +176,10 @@ class TransportAdapterImpl : public TransportAdapter, * * @return Error information about possible reason of sending data failure **/ - virtual TransportAdapter::Error SendData(const DeviceUID& device_handle, - const ApplicationHandle& app_handle, - const ::protocol_handler::RawMessagePtr data); + virtual TransportAdapter::Error SendData( + const DeviceUID& device_handle, + const ApplicationHandle& app_handle, + const ::protocol_handler::RawMessagePtr data); /** * @brief Start client listener. @@ -230,8 +231,8 @@ class TransportAdapterImpl : public TransportAdapter, * * @return Container(vector) that holds application unique identifiers. */ - virtual ApplicationList GetApplicationList(const DeviceUID& device_handle) - const; + virtual ApplicationList GetApplicationList( + const DeviceUID& device_handle) const; /** * @brief Find device in the internal container(map). @@ -436,7 +437,6 @@ class TransportAdapterImpl : public TransportAdapter, */ virtual bool ToBeAutoConnected(DeviceSptr device) const; - /** * @brief Returns true if \a device is to be disconnected automatically when * all applications will be closed @@ -451,11 +451,12 @@ class TransportAdapterImpl : public TransportAdapter, * * @return pointer to the connection. */ - virtual ConnectionSPtr FindEstablishedConnection(const DeviceUID& device_handle, - const ApplicationHandle& app_handle) const; + virtual ConnectionSPtr FindEstablishedConnection( + const DeviceUID& device_handle, + const ApplicationHandle& app_handle) const; const TransportManagerSettings& get_settings() const { - return settings_; + return settings_; } private: @@ -498,11 +499,7 @@ class TransportAdapterImpl : public TransportAdapter, ConnectionSPtr connection; DeviceUID device_id; ApplicationHandle app_handle; - enum { - NEW, - ESTABLISHED, - FINALISING - } state; + enum { NEW, ESTABLISHED, FINALISING } state; }; /** @@ -545,7 +542,7 @@ class TransportAdapterImpl : public TransportAdapter, #endif // TELEMETRY_MONITOR resumption::LastState& last_state() const { - return last_state_; + return last_state_; } /** @@ -570,4 +567,4 @@ class TransportAdapterImpl : public TransportAdapter, } // namespace transport_adapter } // namespace transport_manager -#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_TRANSPORT_ADAPTER_IMPL_H_ +#endif // SRC_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_TRANSPORT_ADAPTER_TRANSPORT_ADAPTER_IMPL_H_ diff --git a/src/components/transport_manager/include/transport_manager/transport_manager_default.h b/src/components/transport_manager/include/transport_manager/transport_manager_default.h index 1fa280fa4f..e89562a28d 100644 --- a/src/components/transport_manager/include/transport_manager/transport_manager_default.h +++ b/src/components/transport_manager/include/transport_manager/transport_manager_default.h @@ -48,25 +48,22 @@ namespace transport_manager { * @brief Default realization of transport_manager_impl class. */ class TransportManagerDefault : public TransportManagerImpl { - -public: - explicit TransportManagerDefault(const TransportManagerSettings& settings); + public: + explicit TransportManagerDefault(const TransportManagerSettings& settings); /** * @brief Initialize transport manager. * * @return Code error. */ - int Init(resumption::LastState &last_state) OVERRIDE; + int Init(resumption::LastState& last_state) OVERRIDE; /** * @brief Destructor. */ virtual ~TransportManagerDefault(); - DISALLOW_COPY_AND_ASSIGN(TransportManagerDefault); - }; } diff --git a/src/components/transport_manager/include/transport_manager/transport_manager_impl.h b/src/components/transport_manager/include/transport_manager/transport_manager_impl.h index 9de6a0720b..47750a68e0 100644 --- a/src/components/transport_manager/include/transport_manager/transport_manager_impl.h +++ b/src/components/transport_manager/include/transport_manager/transport_manager_impl.h @@ -59,22 +59,23 @@ namespace transport_manager { typedef threads::MessageLoopThread<std::queue<protocol_handler::RawMessagePtr> > - RawMessageLoopThread; + RawMessageLoopThread; typedef threads::MessageLoopThread<std::queue<TransportAdapterEvent> > - TransportAdapterEventLoopThread; + TransportAdapterEventLoopThread; typedef utils::SharedPtr<timer::Timer> TimerSPtr; /** * @brief Implementation of transport manager.s */ -class TransportManagerImpl : public TransportManager, - public RawMessageLoopThread::Handler, - public TransportAdapterEventLoopThread::Handler +class TransportManagerImpl + : public TransportManager, + public RawMessageLoopThread::Handler, + public TransportAdapterEventLoopThread::Handler #ifdef TELEMETRY_MONITOR , public telemetry_monitor::TelemetryObservable<TMTelemetryObserver> #endif // TELEMETRY_MONITOR - { + { public: struct Connection { ConnectionUID id; @@ -86,7 +87,7 @@ class TransportManagerImpl : public TransportManager, /** * @brief Structure that contains internal connection parameters */ - struct ConnectionInternal: public Connection { + struct ConnectionInternal : public Connection { TransportManagerImpl* transport_manager; TransportAdapter* transport_adapter; TimerSPtr timer; @@ -103,9 +104,8 @@ class TransportManagerImpl : public TransportManager, void DisconnectFailedRoutine(); }; - public: - + public: /** * @brief Constructor. **/ @@ -121,7 +121,7 @@ class TransportManagerImpl : public TransportManager, * * @return Code error. */ - int Init(resumption::LastState &last_state) OVERRIDE; + int Init(resumption::LastState& last_state) OVERRIDE; /** * Reinitializes transport manager @@ -177,7 +177,8 @@ class TransportManagerImpl : public TransportManager, * * @return Code error. **/ - int SendMessageToDevice(const protocol_handler::RawMessagePtr message) OVERRIDE; + int SendMessageToDevice( + const protocol_handler::RawMessagePtr message) OVERRIDE; /** * @brief Post event in the event queue. @@ -254,7 +255,8 @@ class TransportManagerImpl : public TransportManager, void RaiseEvent(Proc proc, Args... args) { for (TransportManagerListenerList::iterator it = transport_manager_listener_.begin(); - it != transport_manager_listener_.end(); ++it) { + it != transport_manager_listener_.end(); + ++it) { ((*it)->*proc)(args...); } } @@ -306,14 +308,14 @@ class TransportManagerImpl : public TransportManager, DeviceHandle UidToHandle(const DeviceUID& dev_uid, bool& is_new) { { - sync_primitives::AutoReadLock lock(conversion_table_lock); - ConversionTable::iterator it = std::find( - conversion_table_.begin(), conversion_table_.end(), dev_uid); - if (it != conversion_table_.end()) { - is_new = false; - return std::distance(conversion_table_.begin(), it) + - 1; // handle begin since 1 (one) - } + sync_primitives::AutoReadLock lock(conversion_table_lock); + ConversionTable::iterator it = std::find( + conversion_table_.begin(), conversion_table_.end(), dev_uid); + if (it != conversion_table_.end()) { + is_new = false; + return std::distance(conversion_table_.begin(), it) + + 1; // handle begin since 1 (one) + } } is_new = true; sync_primitives::AutoWriteLock lock(conversion_table_lock); @@ -354,7 +356,7 @@ class TransportManagerImpl : public TransportManager, TransportAdapterEventLoopThread event_queue_; const TransportManagerSettings& settings_; typedef std::vector<std::pair<const TransportAdapter*, DeviceInfo> > - DeviceInfoList; + DeviceInfoList; sync_primitives::RWLock device_list_lock_; DeviceInfoList device_list_; @@ -368,12 +370,15 @@ class TransportManagerImpl : public TransportManager, ConnectionUID id, std::map<ConnectionUID, std::pair<unsigned int, unsigned char*> >& container, - unsigned char* data, unsigned int data_size); - bool GetFrameSize(unsigned char* data, unsigned int data_size, + unsigned char* data, + unsigned int data_size); + bool GetFrameSize(unsigned char* data, + unsigned int data_size, unsigned int& frame_size); bool GetFrame(std::map<ConnectionUID, - std::pair<unsigned int, unsigned char*> >& container, - ConnectionUID id, unsigned int frame_size, + std::pair<unsigned int, unsigned char*> >& container, + ConnectionUID id, + unsigned int frame_size, unsigned char** frame); void OnDeviceListUpdated(TransportAdapter* ta); diff --git a/src/components/transport_manager/include/transport_manager/usb/usb_aoa_adapter.h b/src/components/transport_manager/include/transport_manager/usb/usb_aoa_adapter.h index 273e714d4d..92a813ed7c 100644 --- a/src/components/transport_manager/include/transport_manager/usb/usb_aoa_adapter.h +++ b/src/components/transport_manager/include/transport_manager/usb/usb_aoa_adapter.h @@ -44,8 +44,8 @@ namespace transport_adapter { class UsbAoaAdapter : public TransportAdapterImpl { public: - UsbAoaAdapter(resumption::LastState& last_state, - const TransportManagerSettings& settings); + UsbAoaAdapter(resumption::LastState& last_state, + const TransportManagerSettings& settings); virtual ~UsbAoaAdapter(); protected: diff --git a/src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc b/src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc index d8391d7585..a82c40ca15 100644 --- a/src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc +++ b/src/components/transport_manager/src/bluetooth/bluetooth_transport_adapter.cc @@ -54,14 +54,15 @@ namespace transport_adapter { CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager") -BluetoothTransportAdapter::~BluetoothTransportAdapter() { -} +BluetoothTransportAdapter::~BluetoothTransportAdapter() {} -BluetoothTransportAdapter::BluetoothTransportAdapter(resumption::LastState &last_state, const TransportManagerSettings &settings) - : TransportAdapterImpl(new BluetoothDeviceScanner(this, true, 0), - new BluetoothConnectionFactory(this), NULL, - last_state, settings) { -} +BluetoothTransportAdapter::BluetoothTransportAdapter( + resumption::LastState& last_state, const TransportManagerSettings& settings) + : TransportAdapterImpl(new BluetoothDeviceScanner(this, true, 0), + new BluetoothConnectionFactory(this), + NULL, + last_state, + settings) {} DeviceType BluetoothTransportAdapter::GetDeviceType() const { return BLUETOOTH; @@ -72,14 +73,15 @@ void BluetoothTransportAdapter::Store() const { Json::Value bluetooth_adapter_dictionary; Json::Value devices_dictionary; DeviceList device_ids = GetDeviceList(); - for (DeviceList::const_iterator i = device_ids.begin(); i != device_ids.end(); ++i) { + for (DeviceList::const_iterator i = device_ids.begin(); i != device_ids.end(); + ++i) { DeviceUID device_id = *i; DeviceSptr device = FindDevice(device_id); - if (!device) { // device could have been disconnected + if (!device) { // device could have been disconnected continue; } utils::SharedPtr<BluetoothDevice> bluetooth_device = - DeviceSptr::static_pointer_cast<BluetoothDevice>(device); + DeviceSptr::static_pointer_cast<BluetoothDevice>(device); Json::Value device_dictionary; device_dictionary["name"] = bluetooth_device->name(); char address[18]; @@ -87,15 +89,19 @@ void BluetoothTransportAdapter::Store() const { device_dictionary["address"] = std::string(address); Json::Value applications_dictionary; ApplicationList app_ids = bluetooth_device->GetApplicationList(); - for (ApplicationList::const_iterator j = app_ids.begin(); j != app_ids.end(); ++j) { + for (ApplicationList::const_iterator j = app_ids.begin(); + j != app_ids.end(); + ++j) { ApplicationHandle app_handle = *j; - if (FindEstablishedConnection(bluetooth_device->unique_device_id(), app_handle)) { + if (FindEstablishedConnection(bluetooth_device->unique_device_id(), + app_handle)) { uint8_t rfcomm_channel; bluetooth_device->GetRfcommChannel(app_handle, &rfcomm_channel); Json::Value application_dictionary; char rfcomm_channel_record[4]; sprintf(rfcomm_channel_record, "%u", rfcomm_channel); - application_dictionary["rfcomm_channel"] = std::string(rfcomm_channel_record); + application_dictionary["rfcomm_channel"] = + std::string(rfcomm_channel_record); applications_dictionary.append(application_dictionary); } } @@ -106,7 +112,7 @@ void BluetoothTransportAdapter::Store() const { } bluetooth_adapter_dictionary["devices"] = devices_dictionary; last_state().dictionary["TransportManager"]["BluetoothAdapter"] = - bluetooth_adapter_dictionary; + bluetooth_adapter_dictionary; LOG4CXX_TRACE(logger_, "exit"); } @@ -115,33 +121,38 @@ bool BluetoothTransportAdapter::Restore() { bool errors_occured = false; const Json::Value bluetooth_adapter_dictionary = last_state().dictionary["TransportManager"]["BluetoothAdapter"]; - const Json::Value devices_dictionary = bluetooth_adapter_dictionary["devices"]; + const Json::Value devices_dictionary = + bluetooth_adapter_dictionary["devices"]; for (Json::Value::const_iterator i = devices_dictionary.begin(); - i != devices_dictionary.end(); ++i) { + i != devices_dictionary.end(); + ++i) { const Json::Value device_dictionary = *i; std::string name = device_dictionary["name"].asString(); std::string address_record = device_dictionary["address"].asString(); bdaddr_t address; str2ba(address_record.c_str(), &address); RfcommChannelVector rfcomm_channels; - const Json::Value applications_dictionary = device_dictionary["applications"]; + const Json::Value applications_dictionary = + device_dictionary["applications"]; for (Json::Value::const_iterator j = applications_dictionary.begin(); - j != applications_dictionary.end(); ++j) { + j != applications_dictionary.end(); + ++j) { const Json::Value application_dictionary = *j; std::string rfcomm_channel_record = - application_dictionary["rfcomm_channel"].asString(); + application_dictionary["rfcomm_channel"].asString(); uint8_t rfcomm_channel = - static_cast<uint8_t>(atoi(rfcomm_channel_record.c_str())); + static_cast<uint8_t>(atoi(rfcomm_channel_record.c_str())); rfcomm_channels.push_back(rfcomm_channel); } BluetoothDevice* bluetooth_device = - new BluetoothDevice(address, name.c_str(), rfcomm_channels); + new BluetoothDevice(address, name.c_str(), rfcomm_channels); DeviceSptr device(bluetooth_device); AddDevice(device); - for (RfcommChannelVector::const_iterator j = - rfcomm_channels.begin(); j != rfcomm_channels.end(); ++j) { + for (RfcommChannelVector::const_iterator j = rfcomm_channels.begin(); + j != rfcomm_channels.end(); + ++j) { ApplicationHandle app_handle = - *j; // for Bluetooth device app_handle is just RFCOMM channel + *j; // for Bluetooth device app_handle is just RFCOMM channel if (Error::OK != Connect(device->unique_device_id(), app_handle)) { errors_occured = true; } diff --git a/src/components/transport_manager/src/tcp/tcp_transport_adapter.cc b/src/components/transport_manager/src/tcp/tcp_transport_adapter.cc index 1c1f901f0b..a389deb517 100644 --- a/src/components/transport_manager/src/tcp/tcp_transport_adapter.cc +++ b/src/components/transport_manager/src/tcp/tcp_transport_adapter.cc @@ -58,10 +58,10 @@ TcpTransportAdapter::TcpTransportAdapter( : TransportAdapterImpl(NULL, new TcpConnectionFactory(this), new TcpClientListener(this, port, true), - last_state, settings) {} + last_state, + settings) {} -TcpTransportAdapter::~TcpTransportAdapter() { -} +TcpTransportAdapter::~TcpTransportAdapter() {} DeviceType TcpTransportAdapter::GetDeviceType() const { return TCP; @@ -73,14 +73,14 @@ void TcpTransportAdapter::Store() const { Json::Value devices_dictionary; DeviceList device_ids = GetDeviceList(); for (DeviceList::const_iterator i = device_ids.begin(); i != device_ids.end(); - ++i) { + ++i) { DeviceUID device_id = *i; DeviceSptr device = FindDevice(device_id); if (!device) { // device could have been disconnected continue; } - utils::SharedPtr<TcpDevice> tcp_device = DeviceSptr::static_pointer_cast< - TcpDevice>(device); + utils::SharedPtr<TcpDevice> tcp_device = + DeviceSptr::static_pointer_cast<TcpDevice>(device); Json::Value device_dictionary; device_dictionary["name"] = tcp_device->name(); struct in_addr address; @@ -89,7 +89,8 @@ void TcpTransportAdapter::Store() const { Json::Value applications_dictionary; ApplicationList app_ids = tcp_device->GetApplicationList(); for (ApplicationList::const_iterator j = app_ids.begin(); - j != app_ids.end(); ++j) { + j != app_ids.end(); + ++j) { ApplicationHandle app_handle = *j; if (FindEstablishedConnection(tcp_device->unique_device_id(), app_handle)) { @@ -120,7 +121,8 @@ bool TcpTransportAdapter::Restore() { last_state().dictionary["TransportManager"]["TcpAdapter"]; const Json::Value devices_dictionary = tcp_adapter_dictionary["devices"]; for (Json::Value::const_iterator i = devices_dictionary.begin(); - i != devices_dictionary.end(); ++i) { + i != devices_dictionary.end(); + ++i) { const Json::Value device_dictionary = *i; std::string name = device_dictionary["name"].asString(); std::string address_record = device_dictionary["address"].asString(); @@ -131,7 +133,8 @@ bool TcpTransportAdapter::Restore() { const Json::Value applications_dictionary = device_dictionary["applications"]; for (Json::Value::const_iterator j = applications_dictionary.begin(); - j != applications_dictionary.end(); ++j) { + j != applications_dictionary.end(); + ++j) { const Json::Value application_dictionary = *j; std::string port_record = application_dictionary["port"].asString(); int port = atoi(port_record.c_str()); @@ -148,4 +151,3 @@ bool TcpTransportAdapter::Restore() { } // namespace transport_adapter } // namespace transport_manager - diff --git a/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc b/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc index 30b8d5248b..4da069cf8b 100644 --- a/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc +++ b/src/components/transport_manager/src/transport_adapter/transport_adapter_impl.cc @@ -46,13 +46,12 @@ namespace transport_adapter { CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager") namespace { DeviceTypes devicesType = { - std::make_pair(AOA, std::string("USB_AOA")), - std::make_pair(PASA_AOA, std::string("USB_AOA")), - std::make_pair(MME, std::string("USB_IOS")), - std::make_pair(BLUETOOTH, std::string("BLUETOOTH")), - std::make_pair(PASA_BLUETOOTH, std::string("BLUETOOTH")), - std::make_pair(TCP, std::string("WIFI")) -}; + std::make_pair(AOA, std::string("USB_AOA")), + std::make_pair(PASA_AOA, std::string("USB_AOA")), + std::make_pair(MME, std::string("USB_IOS")), + std::make_pair(BLUETOOTH, std::string("BLUETOOTH")), + std::make_pair(PASA_BLUETOOTH, std::string("BLUETOOTH")), + std::make_pair(TCP, std::string("WIFI"))}; } TransportAdapterImpl::TransportAdapterImpl( @@ -69,7 +68,8 @@ TransportAdapterImpl::TransportAdapterImpl( , connections_lock_() , #ifdef TELEMETRY_MONITOR - metric_observer_(NULL), + metric_observer_(NULL) + , #endif // TELEMETRY_MONITOR device_scanner_(device_scanner) , server_connection_factory_(server_connection_factory) @@ -87,12 +87,16 @@ TransportAdapterImpl::~TransportAdapterImpl() { LOG4CXX_DEBUG(logger_, "device_scanner_ deleted."); } if (server_connection_factory_) { - LOG4CXX_DEBUG(logger_, "Deleting server_connection_factory " << server_connection_factory_); + LOG4CXX_DEBUG(logger_, + "Deleting server_connection_factory " + << server_connection_factory_); delete server_connection_factory_; LOG4CXX_DEBUG(logger_, "server_connection_factory deleted."); } if (client_connection_listener_) { - LOG4CXX_DEBUG(logger_, "Deleting client_connection_listener_ " << client_connection_listener_); + LOG4CXX_DEBUG(logger_, + "Deleting client_connection_listener_ " + << client_connection_listener_); delete client_connection_listener_; LOG4CXX_DEBUG(logger_, "client_connection_listener_ deleted."); } @@ -101,15 +105,20 @@ TransportAdapterImpl::~TransportAdapterImpl() { void TransportAdapterImpl::Terminate() { if (device_scanner_) { device_scanner_->Terminate(); - LOG4CXX_DEBUG(logger_, "device_scanner_ " << device_scanner_ << " terminated."); + LOG4CXX_DEBUG(logger_, + "device_scanner_ " << device_scanner_ << " terminated."); } if (server_connection_factory_) { server_connection_factory_->Terminate(); - LOG4CXX_DEBUG(logger_, "server_connection_factory " << server_connection_factory_ << " terminated."); + LOG4CXX_DEBUG(logger_, + "server_connection_factory " << server_connection_factory_ + << " terminated."); } if (client_connection_listener_) { client_connection_listener_->Terminate(); - LOG4CXX_DEBUG(logger_, "client_connection_listener_ " << client_connection_listener_ << " terminated."); + LOG4CXX_DEBUG(logger_, + "client_connection_listener_ " << client_connection_listener_ + << " terminated."); } ConnectionMap connections; @@ -171,9 +180,10 @@ TransportAdapter::Error TransportAdapterImpl::SearchDevices() { } TransportAdapter::Error TransportAdapterImpl::Connect( - const DeviceUID& device_id, const ApplicationHandle& app_handle) { - LOG4CXX_TRACE(logger_, "enter. DeviceUID " << device_id << " ApplicationHandle " << - app_handle); + const DeviceUID& device_id, const ApplicationHandle& app_handle) { + LOG4CXX_TRACE(logger_, + "enter. DeviceUID " << device_id << " ApplicationHandle " + << app_handle); if (server_connection_factory_ == 0) { LOG4CXX_TRACE(logger_, "exit with NOT_SUPPORTED"); return NOT_SUPPORTED; @@ -185,8 +195,8 @@ TransportAdapter::Error TransportAdapterImpl::Connect( connections_lock_.AcquireForWriting(); const bool already_exists = - connections_.end() != - connections_.find(std::make_pair(device_id, app_handle)); + connections_.end() != + connections_.find(std::make_pair(device_id, app_handle)); if (!already_exists) { ConnectionInfo& info = connections_[std::make_pair(device_id, app_handle)]; info.app_handle = app_handle; @@ -200,7 +210,7 @@ TransportAdapter::Error TransportAdapterImpl::Connect( } const TransportAdapter::Error err = - server_connection_factory_->CreateConnection(device_id, app_handle); + server_connection_factory_->CreateConnection(device_id, app_handle); if (TransportAdapter::OK != err) { connections_lock_.AcquireForWriting(); connections_.erase(std::make_pair(device_id, app_handle)); @@ -211,7 +221,7 @@ TransportAdapter::Error TransportAdapterImpl::Connect( } TransportAdapter::Error TransportAdapterImpl::ConnectDevice( - const DeviceUID& device_handle) { + const DeviceUID& device_handle) { LOG4CXX_TRACE(logger_, "enter with device_handle: " << &device_handle); DeviceSptr device = FindDevice(device_handle); if (device) { @@ -225,9 +235,10 @@ TransportAdapter::Error TransportAdapterImpl::ConnectDevice( } TransportAdapter::Error TransportAdapterImpl::Disconnect( - const DeviceUID& device_id, const ApplicationHandle& app_handle) { - LOG4CXX_TRACE(logger_, "enter. device_id: " << &device_id << ", device_id: " << - &device_id); + const DeviceUID& device_id, const ApplicationHandle& app_handle) { + LOG4CXX_TRACE(logger_, + "enter. device_id: " << &device_id + << ", device_id: " << &device_id); if (!initialised_) { LOG4CXX_TRACE(logger_, "exit with BAD_STATE"); return BAD_STATE; @@ -244,7 +255,7 @@ TransportAdapter::Error TransportAdapterImpl::Disconnect( } TransportAdapter::Error TransportAdapterImpl::DisconnectDevice( - const DeviceUID& device_id) { + const DeviceUID& device_id) { LOG4CXX_TRACE(logger_, "enter. device_id: " << &device_id); if (!initialised_) { LOG4CXX_TRACE(logger_, "exit with BAD_STATE"); @@ -255,15 +266,20 @@ TransportAdapter::Error TransportAdapterImpl::DisconnectDevice( std::vector<ConnectionInfo> to_disconnect; connections_lock_.AcquireForReading(); - for (ConnectionMap::const_iterator i = connections_.begin(); i != connections_.end(); ++i) { + for (ConnectionMap::const_iterator i = connections_.begin(); + i != connections_.end(); + ++i) { ConnectionInfo info = i->second; - if (info.device_id == device_id && info.state != ConnectionInfo::FINALISING) { + if (info.device_id == device_id && + info.state != ConnectionInfo::FINALISING) { to_disconnect.push_back(info); } } connections_lock_.Release(); - for (std::vector<ConnectionInfo>::const_iterator j = to_disconnect.begin(); j != to_disconnect.end(); ++j) { + for (std::vector<ConnectionInfo>::const_iterator j = to_disconnect.begin(); + j != to_disconnect.end(); + ++j) { ConnectionInfo info = *j; if (OK != info.connection->Disconnect()) { error = FAIL; @@ -275,10 +291,12 @@ TransportAdapter::Error TransportAdapterImpl::DisconnectDevice( } TransportAdapter::Error TransportAdapterImpl::SendData( - const DeviceUID& device_id, const ApplicationHandle& app_handle, - const ::protocol_handler::RawMessagePtr data) { - LOG4CXX_TRACE(logger_, "enter. device_id: " << &device_id << ", app_handle: " << - &app_handle << ", data: " << data); + const DeviceUID& device_id, + const ApplicationHandle& app_handle, + const ::protocol_handler::RawMessagePtr data) { + LOG4CXX_TRACE(logger_, + "enter. device_id: " << &device_id << ", app_handle: " + << &app_handle << ", data: " << data); if (!initialised_) { LOG4CXX_TRACE(logger_, "exit with BAD_STATE"); return BAD_STATE; @@ -322,9 +340,7 @@ TransportAdapter::Error TransportAdapterImpl::StopClientListening() { } TransportAdapter::Error err = client_connection_listener_->StopListening(); sync_primitives::AutoLock locker(devices_mutex_); - for(DeviceMap::iterator it = devices_.begin(); - it != devices_.end(); - ++it) { + for (DeviceMap::iterator it = devices_.begin(); it != devices_.end(); ++it) { it->second->Stop(); } LOG4CXX_TRACE(logger_, "exit with error: " << err); @@ -339,7 +355,8 @@ DeviceList TransportAdapterImpl::GetDeviceList() const { ++it) { devices.push_back(it->first); } - LOG4CXX_TRACE(logger_, "exit with DeviceList. It's' size = " << devices.size()); + LOG4CXX_TRACE(logger_, + "exit with DeviceList. It's' size = " << devices.size()); return devices; } @@ -366,7 +383,8 @@ DeviceSptr TransportAdapterImpl::AddDevice(DeviceSptr device) { return existing_device; } else { for (TransportAdapterListenerList::iterator it = listeners_.begin(); - it != listeners_.end(); ++it) { + it != listeners_.end(); + ++it) { (*it)->OnDeviceListUpdated(this); } if (ToBeAutoConnected(device)) { @@ -399,9 +417,9 @@ void TransportAdapterImpl::SearchDeviceDone(const DeviceVector& devices) { devices_mutex_.Release(); if (!device_found) { - LOG4CXX_INFO(logger_, "Adding new device " << device->unique_device_id() - << " (\"" << device->name() - << "\")"); + LOG4CXX_INFO(logger_, + "Adding new device " << device->unique_device_id() << " (\"" + << device->name() << "\")"); } device->set_keep_on_disconnect(true); @@ -411,7 +429,8 @@ void TransportAdapterImpl::SearchDeviceDone(const DeviceVector& devices) { connections_lock_.AcquireForReading(); std::set<DeviceUID> connected_devices; for (ConnectionMap::const_iterator it = connections_.begin(); - it != connections_.end(); ++it) { + it != connections_.end(); + ++it) { const ConnectionInfo& info = it->second; if (info.state != ConnectionInfo::FINALISING) { connected_devices.insert(info.device_id); @@ -435,12 +454,14 @@ void TransportAdapterImpl::SearchDeviceDone(const DeviceVector& devices) { devices_mutex_.Release(); for (TransportAdapterListenerList::iterator it = listeners_.begin(); - it != listeners_.end(); ++it) { + it != listeners_.end(); + ++it) { (*it)->OnDeviceListUpdated(this); (*it)->OnSearchDeviceDone(this); } - for (DeviceMap::iterator it = new_devices.begin(); it != new_devices.end(); ++it) { + for (DeviceMap::iterator it = new_devices.begin(); it != new_devices.end(); + ++it) { DeviceSptr device = it->second; if (ToBeAutoConnected(device)) { ConnectDevice(device); @@ -449,14 +470,16 @@ void TransportAdapterImpl::SearchDeviceDone(const DeviceVector& devices) { LOG4CXX_TRACE(logger_, "exit"); } -void TransportAdapterImpl::ApplicationListUpdated(const DeviceUID& device_handle) { +void TransportAdapterImpl::ApplicationListUpdated( + const DeviceUID& device_handle) { // default implementation does nothing // and is reimplemented in MME transport adapter only } void TransportAdapterImpl::FindNewApplicationsRequest() { LOG4CXX_TRACE(logger_, "enter"); - for (TransportAdapterListenerList::iterator i = listeners_.begin(); i != listeners_.end(); + for (TransportAdapterListenerList::iterator i = listeners_.begin(); + i != listeners_.end(); ++i) { TransportAdapterListener* listener = *i; listener->OnFindNewApplicationsRequest(this); @@ -467,7 +490,8 @@ void TransportAdapterImpl::FindNewApplicationsRequest() { void TransportAdapterImpl::SearchDeviceFailed(const SearchDeviceError& error) { LOG4CXX_TRACE(logger_, "enter"); for (TransportAdapterListenerList::iterator it = listeners_.begin(); - it != listeners_.end(); ++it) { + it != listeners_.end(); + ++it) { (*it)->OnSearchDeviceFailed(this, error); } LOG4CXX_TRACE(logger_, "exit"); @@ -491,10 +515,13 @@ bool TransportAdapterImpl::IsClientOriginatedConnectSupported() const { } void TransportAdapterImpl::ConnectionCreated( - ConnectionSPtr connection, const DeviceUID& device_id, - const ApplicationHandle& app_handle) { - LOG4CXX_TRACE(logger_, "enter connection:" << connection << ", device_id: " << &device_id - << ", app_handle: " << &app_handle); + ConnectionSPtr connection, + const DeviceUID& device_id, + const ApplicationHandle& app_handle) { + LOG4CXX_TRACE(logger_, + "enter connection:" << connection + << ", device_id: " << &device_id + << ", app_handle: " << &app_handle); connections_lock_.AcquireForReading(); ConnectionInfo& info = connections_[std::make_pair(device_id, app_handle)]; info.app_handle = app_handle; @@ -507,26 +534,34 @@ void TransportAdapterImpl::ConnectionCreated( void TransportAdapterImpl::DeviceDisconnected( const DeviceUID& device_handle, const DisconnectDeviceError& error) { const DeviceUID device_uid = device_handle; - LOG4CXX_TRACE(logger_, "enter. device_handle: " << &device_uid << ", error: " << - &error); + LOG4CXX_TRACE(logger_, + "enter. device_handle: " << &device_uid + << ", error: " << &error); ApplicationList app_list = GetApplicationList(device_uid); - for (ApplicationList::const_iterator i = app_list.begin(); i != app_list.end(); ++i) { + for (ApplicationList::const_iterator i = app_list.begin(); + i != app_list.end(); + ++i) { ApplicationHandle app_handle = *i; for (TransportAdapterListenerList::iterator it = listeners_.begin(); - it != listeners_.end(); ++it) { + it != listeners_.end(); + ++it) { TransportAdapterListener* listener = *it; - listener->OnUnexpectedDisconnect(this, device_uid, app_handle, CommunicationError()); + listener->OnUnexpectedDisconnect( + this, device_uid, app_handle, CommunicationError()); } } for (TransportAdapterListenerList::iterator it = listeners_.begin(); - it != listeners_.end(); ++it) { + it != listeners_.end(); + ++it) { TransportAdapterListener* listener = *it; listener->OnDisconnectDeviceDone(this, device_uid); } connections_lock_.AcquireForWriting(); - for (ApplicationList::const_iterator i = app_list.begin(); i != app_list.end(); ++i) { + for (ApplicationList::const_iterator i = app_list.begin(); + i != app_list.end(); + ++i) { ApplicationHandle app_handle = *i; connections_.erase(std::make_pair(device_uid, app_handle)); } @@ -536,16 +571,18 @@ void TransportAdapterImpl::DeviceDisconnected( LOG4CXX_TRACE(logger_, "exit"); } -bool TransportAdapterImpl::IsSingleApplication(const DeviceUID& device_uid, - const ApplicationHandle& app_uid) { +bool TransportAdapterImpl::IsSingleApplication( + const DeviceUID& device_uid, const ApplicationHandle& app_uid) { sync_primitives::AutoReadLock locker(connections_lock_); for (ConnectionMap::const_iterator it = connections_.begin(); - it != connections_.end(); ++it) { + it != connections_.end(); + ++it) { const DeviceUID& current_device_id = it->first.first; const ApplicationHandle& current_app_handle = it->first.second; if (current_device_id == device_uid && current_app_handle != app_uid) { LOG4CXX_DEBUG(logger_, - "break. Condition: current_device_id == device_id && current_app_handle != app_handle"); + "break. Condition: current_device_id == device_id && " + "current_app_handle != app_handle"); return false; } @@ -553,23 +590,25 @@ bool TransportAdapterImpl::IsSingleApplication(const DeviceUID& device_uid, return true; } -void TransportAdapterImpl::DisconnectDone( - const DeviceUID& device_handle, const ApplicationHandle& app_handle) { +void TransportAdapterImpl::DisconnectDone(const DeviceUID& device_handle, + const ApplicationHandle& app_handle) { const DeviceUID device_uid = device_handle; const ApplicationHandle app_uid = app_handle; - LOG4CXX_TRACE(logger_, "enter. device_id: " << &device_uid << ", app_handle: " << - &app_uid); + LOG4CXX_TRACE(logger_, + "enter. device_id: " << &device_uid + << ", app_handle: " << &app_uid); DeviceSptr device = FindDevice(device_handle); if (!device) { LOG4CXX_WARN(logger_, "Device: uid " << &device_uid << " not found"); return; } - bool device_disconnected = ToBeAutoDisconnected(device) && - IsSingleApplication(device_uid, app_uid); + bool device_disconnected = + ToBeAutoDisconnected(device) && IsSingleApplication(device_uid, app_uid); for (TransportAdapterListenerList::iterator it = listeners_.begin(); - it != listeners_.end(); ++it) { + it != listeners_.end(); + ++it) { TransportAdapterListener* listener = *it; listener->OnDisconnectDone(this, device_uid, app_uid); if (device_disconnected) { @@ -588,11 +627,14 @@ void TransportAdapterImpl::DisconnectDone( LOG4CXX_TRACE(logger_, "exit"); } -void TransportAdapterImpl::DataReceiveDone(const DeviceUID& device_id, +void TransportAdapterImpl::DataReceiveDone( + const DeviceUID& device_id, const ApplicationHandle& app_handle, ::protocol_handler::RawMessagePtr message) { - LOG4CXX_TRACE(logger_, "enter. device_id: " << &device_id << ", app_handle: " << - &app_handle << ", message: " << message); + LOG4CXX_TRACE(logger_, + "enter. device_id: " << &device_id + << ", app_handle: " << &app_handle + << ", message: " << message); #ifdef TELEMETRY_MONITOR if (metric_observer_) { @@ -601,41 +643,48 @@ void TransportAdapterImpl::DataReceiveDone(const DeviceUID& device_id, #endif // TELEMETRY_MONITOR for (TransportAdapterListenerList::iterator it = listeners_.begin(); - it != listeners_.end(); ++it) { + it != listeners_.end(); + ++it) { (*it)->OnDataReceiveDone(this, device_id, app_handle, message); } LOG4CXX_TRACE(logger_, "exit"); } void TransportAdapterImpl::DataReceiveFailed( - const DeviceUID& device_id, const ApplicationHandle& app_handle, - const DataReceiveError& error) { + const DeviceUID& device_id, + const ApplicationHandle& app_handle, + const DataReceiveError& error) { LOG4CXX_TRACE(logger_, "enter"); for (TransportAdapterListenerList::iterator it = listeners_.begin(); - it != listeners_.end(); ++it) { + it != listeners_.end(); + ++it) { (*it)->OnDataReceiveFailed(this, device_id, app_handle, error); } LOG4CXX_TRACE(logger_, "exit"); } -void TransportAdapterImpl::DataSendDone(const DeviceUID& device_id, - const ApplicationHandle& app_handle, - ::protocol_handler::RawMessagePtr message) { +void TransportAdapterImpl::DataSendDone( + const DeviceUID& device_id, + const ApplicationHandle& app_handle, + ::protocol_handler::RawMessagePtr message) { LOG4CXX_TRACE(logger_, "enter"); for (TransportAdapterListenerList::iterator it = listeners_.begin(); - it != listeners_.end(); ++it) { + it != listeners_.end(); + ++it) { (*it)->OnDataSendDone(this, device_id, app_handle, message); } LOG4CXX_TRACE(logger_, "exit"); } -void TransportAdapterImpl::DataSendFailed(const DeviceUID& device_id, +void TransportAdapterImpl::DataSendFailed( + const DeviceUID& device_id, const ApplicationHandle& app_handle, ::protocol_handler::RawMessagePtr message, const DataSendError& error) { LOG4CXX_TRACE(logger_, "enter"); for (TransportAdapterListenerList::iterator it = listeners_.begin(); - it != listeners_.end(); ++it) { + it != listeners_.end(); + ++it) { (*it)->OnDataSendFailed(this, device_id, app_handle, message, error); } LOG4CXX_TRACE(logger_, "exit"); @@ -658,11 +707,12 @@ DeviceSptr TransportAdapterImpl::FindDevice(const DeviceUID& device_id) const { void TransportAdapterImpl::ConnectDone(const DeviceUID& device_id, const ApplicationHandle& app_handle) { - LOG4CXX_TRACE(logger_, "enter. device_id: " << &device_id << ", app_handle: " << - &app_handle); + LOG4CXX_TRACE(logger_, + "enter. device_id: " << &device_id + << ", app_handle: " << &app_handle); connections_lock_.AcquireForReading(); ConnectionMap::iterator it_conn = - connections_.find(std::make_pair(device_id, app_handle)); + connections_.find(std::make_pair(device_id, app_handle)); if (it_conn != connections_.end()) { ConnectionInfo& info = it_conn->second; info.state = ConnectionInfo::ESTABLISHED; @@ -670,7 +720,8 @@ void TransportAdapterImpl::ConnectDone(const DeviceUID& device_id, connections_lock_.Release(); for (TransportAdapterListenerList::iterator it = listeners_.begin(); - it != listeners_.end(); ++it) { + it != listeners_.end(); + ++it) { (*it)->OnConnectDone(this, device_id, app_handle); } @@ -679,16 +730,19 @@ void TransportAdapterImpl::ConnectDone(const DeviceUID& device_id, } void TransportAdapterImpl::ConnectFailed(const DeviceUID& device_handle, - const ApplicationHandle& app_handle, const ConnectError& error) { + const ApplicationHandle& app_handle, + const ConnectError& error) { const DeviceUID device_uid = device_handle; const ApplicationHandle app_uid = app_handle; - LOG4CXX_TRACE(logger_, "enter. device_id: " << &device_uid << ", app_handle: " << - &app_uid << ", error: " << &error); + LOG4CXX_TRACE(logger_, + "enter. device_id: " << &device_uid << ", app_handle: " + << &app_uid << ", error: " << &error); connections_lock_.AcquireForWriting(); connections_.erase(std::make_pair(device_uid, app_uid)); connections_lock_.Release(); for (TransportAdapterListenerList::iterator it = listeners_.begin(); - it != listeners_.end(); ++it) { + it != listeners_.end(); + ++it) { (*it)->OnConnectFailed(this, device_uid, app_uid, error); } LOG4CXX_TRACE(logger_, "exit"); @@ -701,26 +755,30 @@ void TransportAdapterImpl::AddListener(TransportAdapterListener* listener) { } ApplicationList TransportAdapterImpl::GetApplicationList( - const DeviceUID& device_id) const { + const DeviceUID& device_id) const { LOG4CXX_TRACE(logger_, "enter. device_id: " << &device_id); DeviceSptr device = FindDevice(device_id); if (device.valid()) { ApplicationList lst = device->GetApplicationList(); - LOG4CXX_TRACE(logger_, "exit with ApplicationList. It's size = " << lst.size() << - " Condition: device.valid()"); + LOG4CXX_TRACE(logger_, + "exit with ApplicationList. It's size = " + << lst.size() << " Condition: device.valid()"); return lst; } - LOG4CXX_TRACE(logger_, "exit with empty ApplicationList. Condition: NOT device.valid()"); + LOG4CXX_TRACE( + logger_, + "exit with empty ApplicationList. Condition: NOT device.valid()"); return ApplicationList(); } void TransportAdapterImpl::ConnectionFinished( - const DeviceUID& device_id, const ApplicationHandle& app_handle) { - LOG4CXX_TRACE(logger_, "enter. device_id: " << &device_id << ", app_handle: " << - &app_handle); + const DeviceUID& device_id, const ApplicationHandle& app_handle) { + LOG4CXX_TRACE(logger_, + "enter. device_id: " << &device_id + << ", app_handle: " << &app_handle); connections_lock_.AcquireForReading(); ConnectionMap::iterator it = - connections_.find(std::make_pair(device_id, app_handle)); + connections_.find(std::make_pair(device_id, app_handle)); if (it != connections_.end()) { ConnectionInfo& info = it->second; info.state = ConnectionInfo::FINALISING; @@ -729,11 +787,13 @@ void TransportAdapterImpl::ConnectionFinished( } void TransportAdapterImpl::ConnectionAborted( - const DeviceUID& device_id, const ApplicationHandle& app_handle, - const CommunicationError& error) { + const DeviceUID& device_id, + const ApplicationHandle& app_handle, + const CommunicationError& error) { ConnectionFinished(device_id, app_handle); for (TransportAdapterListenerList::iterator it = listeners_.begin(); - it != listeners_.end(); ++it) { + it != listeners_.end(); + ++it) { (*it)->OnUnexpectedDisconnect(this, device_id, app_handle, error); } } @@ -746,19 +806,22 @@ bool TransportAdapterImpl::IsInitialised() const { } if (device_scanner_ && !device_scanner_->IsInitialised()) { LOG4CXX_TRACE(logger_, - "exit with FALSE. Condition: device_scanner_ && !device_scanner_->IsInitialised()"); + "exit with FALSE. Condition: device_scanner_ && " + "!device_scanner_->IsInitialised()"); return false; } if (server_connection_factory_ && !server_connection_factory_->IsInitialised()) { LOG4CXX_TRACE(logger_, - "exit with FALSE. Condition: server_connection_factory_ && !server_connection_factory_->IsInitialised()"); + "exit with FALSE. Condition: server_connection_factory_ && " + "!server_connection_factory_->IsInitialised()"); return false; } if (client_connection_listener_ && !client_connection_listener_->IsInitialised()) { LOG4CXX_TRACE(logger_, - "exit with FALSE. Condition: client_connection_listener_ && !client_connection_listener_->IsInitialised()"); + "exit with FALSE. Condition: client_connection_listener_ && " + "!client_connection_listener_->IsInitialised()"); return false; } LOG4CXX_TRACE(logger_, "exit with TRUE"); @@ -790,8 +853,7 @@ TMTelemetryObserver* TransportAdapterImpl::GetTelemetryObserver() { } #endif // TELEMETRY_MONITOR -void TransportAdapterImpl::Store() const { -} +void TransportAdapterImpl::Store() const {} bool TransportAdapterImpl::Restore() { return true; @@ -806,13 +868,14 @@ bool TransportAdapterImpl::ToBeAutoDisconnected(DeviceSptr device) const { } ConnectionSPtr TransportAdapterImpl::FindEstablishedConnection( - const DeviceUID& device_id, const ApplicationHandle& app_handle) const { - LOG4CXX_TRACE(logger_, "enter. device_id: " << &device_id << ", app_handle: " << - &app_handle); + const DeviceUID& device_id, const ApplicationHandle& app_handle) const { + LOG4CXX_TRACE(logger_, + "enter. device_id: " << &device_id + << ", app_handle: " << &app_handle); ConnectionSPtr connection; connections_lock_.AcquireForReading(); ConnectionMap::const_iterator it = - connections_.find(std::make_pair(device_id, app_handle)); + connections_.find(std::make_pair(device_id, app_handle)); if (it != connections_.end()) { const ConnectionInfo& info = it->second; if (info.state == ConnectionInfo::ESTABLISHED) { @@ -828,13 +891,16 @@ TransportAdapter::Error TransportAdapterImpl::ConnectDevice(DeviceSptr device) { LOG4CXX_TRACE(logger_, "enter. device: " << device); DeviceUID device_id = device->unique_device_id(); ApplicationList app_list = device->GetApplicationList(); - LOG4CXX_INFO(logger_, "Device " << device->name() << " has " - << app_list.size() << " applications."); + LOG4CXX_INFO(logger_, + "Device " << device->name() << " has " << app_list.size() + << " applications."); bool errors_occurred = false; - for (ApplicationList::iterator it = app_list.begin(); it != app_list.end(); ++it) { + for (ApplicationList::iterator it = app_list.begin(); it != app_list.end(); + ++it) { const ApplicationHandle app_handle = *it; - LOG4CXX_DEBUG(logger_, "Attempt to connect device " << device_id << - ", channel " << app_handle); + LOG4CXX_DEBUG(logger_, + "Attempt to connect device " << device_id << ", channel " + << app_handle); const Error error = Connect(device_id, app_handle); switch (error) { case OK: @@ -844,9 +910,10 @@ TransportAdapter::Error TransportAdapterImpl::ConnectDevice(DeviceSptr device) { LOG4CXX_DEBUG(logger_, "error = ALREADY_EXISTS"); break; default: - LOG4CXX_ERROR(logger_, "Connect to device " << device_id << - ", channel " << app_handle << - " failed with error " << error); + LOG4CXX_ERROR(logger_, + "Connect to device " << device_id << ", channel " + << app_handle + << " failed with error " << error); errors_occurred = true; LOG4CXX_DEBUG(logger_, "switch (error), default case"); break; @@ -871,7 +938,8 @@ void TransportAdapterImpl::RemoveDevice(const DeviceUID& device_handle) { if (!device->keep_on_disconnect()) { devices_.erase(i); for (TransportAdapterListenerList::iterator it = listeners_.begin(); - it != listeners_.end(); ++it) { + it != listeners_.end(); + ++it) { TransportAdapterListener* listener = *it; listener->OnDeviceListUpdated(this); } diff --git a/src/components/transport_manager/src/transport_manager_default.cc b/src/components/transport_manager/src/transport_manager_default.cc index a1718e2cd2..31f398233b 100644 --- a/src/components/transport_manager/src/transport_manager_default.cc +++ b/src/components/transport_manager/src/transport_manager_default.cc @@ -40,13 +40,10 @@ #include "transport_manager/bluetooth/bluetooth_transport_adapter.h" #endif - #if defined(USB_SUPPORT) #include "transport_manager/usb/usb_aoa_adapter.h" #endif // USB_SUPPORT - - namespace transport_manager { CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager") @@ -65,7 +62,8 @@ int TransportManagerDefault::Init(resumption::LastState& last_state) { #ifdef BLUETOOTH_SUPPORT transport_adapter::TransportAdapterImpl* ta_bluetooth = - new transport_adapter::BluetoothTransportAdapter(last_state, get_settings()); + new transport_adapter::BluetoothTransportAdapter(last_state, + get_settings()); #ifdef TELEMETRY_MONITOR if (metric_observer_) { ta_bluetooth->SetTelemetryObserver(metric_observer_); @@ -75,10 +73,10 @@ int TransportManagerDefault::Init(resumption::LastState& last_state) { ta_bluetooth = NULL; #endif - const uint16_t port = - get_settings().transport_manager_tcp_adapter_port(); + const uint16_t port = get_settings().transport_manager_tcp_adapter_port(); transport_adapter::TransportAdapterImpl* ta_tcp = - new transport_adapter::TcpTransportAdapter(port, last_state, get_settings()); + new transport_adapter::TcpTransportAdapter( + port, last_state, get_settings()); #ifdef TELEMETRY_MONITOR if (metric_observer_) { ta_tcp->SetTelemetryObserver(metric_observer_); @@ -87,7 +85,6 @@ int TransportManagerDefault::Init(resumption::LastState& last_state) { AddTransportAdapter(ta_tcp); ta_tcp = NULL; - #if defined(USB_SUPPORT) transport_adapter::TransportAdapterImpl* ta_usb = new transport_adapter::UsbAoaAdapter(last_state, get_settings()); diff --git a/src/components/transport_manager/src/transport_manager_impl.cc b/src/components/transport_manager/src/transport_manager_impl.cc index 5635bf1fd3..a33fe86a12 100644 --- a/src/components/transport_manager/src/transport_manager_impl.cc +++ b/src/components/transport_manager/src/transport_manager_impl.cc @@ -60,14 +60,16 @@ namespace transport_manager { CREATE_LOGGERPTR_GLOBAL(logger_, "TransportManager") TransportManagerImpl::Connection TransportManagerImpl::convert( - const TransportManagerImpl::ConnectionInternal& p) { + const TransportManagerImpl::ConnectionInternal& p) { LOG4CXX_TRACE(logger_, "enter. ConnectionInternal: " << &p); TransportManagerImpl::Connection c; c.application = p.application; c.device = p.device; c.id = p.id; - LOG4CXX_TRACE(logger_, "exit with TransportManagerImpl::Connection. It's ConnectionUID = " - << c.id); + LOG4CXX_TRACE( + logger_, + "exit with TransportManagerImpl::Connection. It's ConnectionUID = " + << c.id); return c; } @@ -90,14 +92,16 @@ TransportManagerImpl::~TransportManagerImpl() { event_queue_.Shutdown(); for (std::vector<TransportAdapter*>::iterator it = - transport_adapters_.begin(); - it != transport_adapters_.end(); ++it) { + transport_adapters_.begin(); + it != transport_adapters_.end(); + ++it) { delete *it; } for (std::map<TransportAdapter*, TransportAdapterListenerImpl*>::iterator it = - transport_adapter_listeners_.begin(); - it != transport_adapter_listeners_.end(); ++it) { + transport_adapter_listeners_.begin(); + it != transport_adapter_listeners_.end(); + ++it) { delete it->second; } @@ -108,8 +112,9 @@ int TransportManagerImpl::ConnectDevice(const DeviceHandle device_handle) { LOG4CXX_TRACE(logger_, "enter. DeviceHandle: " << &device_handle); if (!this->is_initialized_) { LOG4CXX_ERROR(logger_, "TransportManager is not initialized."); - LOG4CXX_TRACE(logger_, - "exit with E_TM_IS_NOT_INITIALIZED. Condition: !this->is_initialized_"); + LOG4CXX_TRACE( + logger_, + "exit with E_TM_IS_NOT_INITIALIZED. Condition: !this->is_initialized_"); return E_TM_IS_NOT_INITIALIZED; } @@ -117,7 +122,7 @@ int TransportManagerImpl::ConnectDevice(const DeviceHandle device_handle) { LOG4CXX_DEBUG(logger_, "Convert handle to id:" << device_id); sync_primitives::AutoReadLock lock(device_to_adapter_map_lock_); - DeviceToAdapterMap::iterator it = device_to_adapter_map_.find(device_id); + DeviceToAdapterMap::iterator it = device_to_adapter_map_.find(device_id); if (it == device_to_adapter_map_.end()) { LOG4CXX_ERROR(logger_, "No device adapter found by id " << device_id); LOG4CXX_TRACE(logger_, "exit with E_INVALID_HANDLE. Condition: NULL == ta"); @@ -135,15 +140,16 @@ int TransportManagerImpl::DisconnectDevice(const DeviceHandle device_handle) { LOG4CXX_TRACE(logger_, "enter. DeviceHandle: " << &device_handle); if (!this->is_initialized_) { LOG4CXX_ERROR(logger_, "TransportManager is not initialized."); - LOG4CXX_TRACE(logger_, - "exit with E_TM_IS_NOT_INITIALIZED. Condition: !this->is_initialized_"); + LOG4CXX_TRACE( + logger_, + "exit with E_TM_IS_NOT_INITIALIZED. Condition: !this->is_initialized_"); return E_TM_IS_NOT_INITIALIZED; } DeviceUID device_id = converter_.HandleToUid(device_handle); LOG4CXX_DEBUG(logger_, "Convert handle to id:" << device_id); sync_primitives::AutoReadLock lock(device_to_adapter_map_lock_); - DeviceToAdapterMap::iterator it = device_to_adapter_map_.find(device_id); + DeviceToAdapterMap::iterator it = device_to_adapter_map_.find(device_id); if (it == device_to_adapter_map_.end()) { LOG4CXX_WARN(logger_, "No device adapter found by id " << device_id); LOG4CXX_TRACE(logger_, "exit with E_INVALID_HANDLE. Condition: NULL == ta"); @@ -159,21 +165,25 @@ int TransportManagerImpl::Disconnect(const ConnectionUID cid) { LOG4CXX_TRACE(logger_, "enter. ConnectionUID: " << &cid); if (!this->is_initialized_) { LOG4CXX_ERROR(logger_, "TransportManager is not initialized."); - LOG4CXX_TRACE(logger_, - "exit with E_TM_IS_NOT_INITIALIZED. Condition: !this->is_initialized_"); + LOG4CXX_TRACE( + logger_, + "exit with E_TM_IS_NOT_INITIALIZED. Condition: !this->is_initialized_"); return E_TM_IS_NOT_INITIALIZED; } sync_primitives::AutoReadLock lock(connections_lock_); ConnectionInternal* connection = GetConnection(cid); if (NULL == connection) { - LOG4CXX_ERROR(logger_, "TransportManagerImpl::Disconnect: Connection does not exist."); - LOG4CXX_TRACE(logger_, "exit with E_INVALID_HANDLE. Condition: NULL == connection"); + LOG4CXX_ERROR( + logger_, + "TransportManagerImpl::Disconnect: Connection does not exist."); + LOG4CXX_TRACE(logger_, + "exit with E_INVALID_HANDLE. Condition: NULL == connection"); return E_INVALID_HANDLE; } connection->transport_adapter->Disconnect(connection->device, - connection->application); + connection->application); // TODO(dchmerev@luxoft.com): Return disconnect timeout /* int messages_count = 0; @@ -208,20 +218,22 @@ int TransportManagerImpl::DisconnectForce(const ConnectionUID cid) { if (false == this->is_initialized_) { LOG4CXX_ERROR(logger_, "TransportManager is not initialized."); LOG4CXX_TRACE(logger_, - "exit with E_TM_IS_NOT_INITIALIZED. Condition: false == this->is_initialized_"); + "exit with E_TM_IS_NOT_INITIALIZED. Condition: false == " + "this->is_initialized_"); return E_TM_IS_NOT_INITIALIZED; } sync_primitives::AutoReadLock lock(connections_lock_); const ConnectionInternal* connection = GetConnection(cid); if (NULL == connection) { LOG4CXX_ERROR( - logger_, - "TransportManagerImpl::DisconnectForce: Connection does not exist."); - LOG4CXX_TRACE(logger_, "exit with E_INVALID_HANDLE. Condition: NULL == connection"); + logger_, + "TransportManagerImpl::DisconnectForce: Connection does not exist."); + LOG4CXX_TRACE(logger_, + "exit with E_INVALID_HANDLE. Condition: NULL == connection"); return E_INVALID_HANDLE; } connection->transport_adapter->Disconnect(connection->device, - connection->application); + connection->application); LOG4CXX_TRACE(logger_, "exit with E_SUCCESS"); return E_SUCCESS; } @@ -237,7 +249,8 @@ void TransportManagerImpl::DisconnectAllDevices() { LOG4CXX_AUTO_TRACE(logger_); sync_primitives::AutoReadLock lock(device_list_lock_); for (DeviceInfoList::iterator i = device_list_.begin(); - i != device_list_.end(); ++i) { + i != device_list_.end(); + ++i) { DeviceInfo& device = i->second; DisconnectDevice(device.device_handle()); } @@ -246,7 +259,8 @@ void TransportManagerImpl::DisconnectAllDevices() { void TransportManagerImpl::TerminateAllAdapters() { LOG4CXX_AUTO_TRACE(logger_); for (std::vector<TransportAdapter*>::iterator i = transport_adapters_.begin(); - i != transport_adapters_.end(); ++i) { + i != transport_adapters_.end(); + ++i) { (*i)->Terminate(); } } @@ -254,7 +268,8 @@ void TransportManagerImpl::TerminateAllAdapters() { int TransportManagerImpl::InitAllAdapters() { LOG4CXX_AUTO_TRACE(logger_); for (std::vector<TransportAdapter*>::iterator i = transport_adapters_.begin(); - i != transport_adapters_.end(); ++i) { + i != transport_adapters_.end(); + ++i) { if ((*i)->Init() != TransportAdapter::OK) { return E_ADAPTERS_FAIL; } @@ -279,33 +294,42 @@ int TransportManagerImpl::Stop() { return E_SUCCESS; } -int TransportManagerImpl::SendMessageToDevice(const ::protocol_handler::RawMessagePtr message) { +int TransportManagerImpl::SendMessageToDevice( + const ::protocol_handler::RawMessagePtr message) { LOG4CXX_TRACE(logger_, "enter. RawMessageSptr: " << message); - LOG4CXX_INFO(logger_, "Send message to device called with arguments " - << message.get()); + LOG4CXX_INFO(logger_, + "Send message to device called with arguments " + << message.get()); if (false == this->is_initialized_) { LOG4CXX_ERROR(logger_, "TM is not initialized."); LOG4CXX_TRACE(logger_, - "exit with E_TM_IS_NOT_INITIALIZED. Condition: false == this->is_initialized_"); + "exit with E_TM_IS_NOT_INITIALIZED. Condition: false == " + "this->is_initialized_"); return E_TM_IS_NOT_INITIALIZED; } { - sync_primitives::AutoReadLock lock(connections_lock_); - const ConnectionInternal* connection = GetConnection(message->connection_key()); - if (NULL == connection) { - LOG4CXX_ERROR(logger_, "Connection with id " << message->connection_key() - << " does not exist."); - LOG4CXX_TRACE(logger_, "exit with E_INVALID_HANDLE. Condition: NULL == connection"); - return E_INVALID_HANDLE; - } + sync_primitives::AutoReadLock lock(connections_lock_); + const ConnectionInternal* connection = + GetConnection(message->connection_key()); + if (NULL == connection) { + LOG4CXX_ERROR(logger_, + "Connection with id " << message->connection_key() + << " does not exist."); + LOG4CXX_TRACE( + logger_, "exit with E_INVALID_HANDLE. Condition: NULL == connection"); + return E_INVALID_HANDLE; + } - if (connection->shutdown_) { - LOG4CXX_ERROR(logger_, "TransportManagerImpl::Disconnect: Connection is to shut down."); - LOG4CXX_TRACE(logger_, - "exit with E_CONNECTION_IS_TO_SHUTDOWN. Condition: connection->shutDown"); - return E_CONNECTION_IS_TO_SHUTDOWN; - } + if (connection->shutdown_) { + LOG4CXX_ERROR( + logger_, + "TransportManagerImpl::Disconnect: Connection is to shut down."); + LOG4CXX_TRACE(logger_, + "exit with E_CONNECTION_IS_TO_SHUTDOWN. Condition: " + "connection->shutDown"); + return E_CONNECTION_IS_TO_SHUTDOWN; + } } #ifdef TELEMETRY_MONITOR if (metric_observer_) { @@ -317,12 +341,14 @@ int TransportManagerImpl::SendMessageToDevice(const ::protocol_handler::RawMessa return E_SUCCESS; } -int TransportManagerImpl::ReceiveEventFromDevice(const TransportAdapterEvent& event) { +int TransportManagerImpl::ReceiveEventFromDevice( + const TransportAdapterEvent& event) { LOG4CXX_TRACE(logger_, "enter. TransportAdapterEvent: " << &event); if (!is_initialized_) { LOG4CXX_ERROR(logger_, "TM is not initialized."); LOG4CXX_TRACE(logger_, - "exit with E_TM_IS_NOT_INITIALIZED. Condition: false == this->is_initialized_"); + "exit with E_TM_IS_NOT_INITIALIZED. Condition: false == " + "this->is_initialized_"); return E_TM_IS_NOT_INITIALIZED; } this->PostEvent(event); @@ -336,7 +362,8 @@ int TransportManagerImpl::RemoveDevice(const DeviceHandle device_handle) { if (false == this->is_initialized_) { LOG4CXX_ERROR(logger_, "TM is not initialized."); LOG4CXX_TRACE(logger_, - "exit with E_TM_IS_NOT_INITIALIZED. Condition: false == this->is_initialized_"); + "exit with E_TM_IS_NOT_INITIALIZED. Condition: false == " + "this->is_initialized_"); return E_TM_IS_NOT_INITIALIZED; } sync_primitives::AutoWriteLock lock(device_to_adapter_map_lock_); @@ -346,20 +373,22 @@ int TransportManagerImpl::RemoveDevice(const DeviceHandle device_handle) { } int TransportManagerImpl::AddTransportAdapter( - transport_adapter::TransportAdapter* transport_adapter) { + transport_adapter::TransportAdapter* transport_adapter) { LOG4CXX_TRACE(logger_, "enter. TransportAdapter: " << transport_adapter); if (transport_adapter_listeners_.find(transport_adapter) != transport_adapter_listeners_.end()) { LOG4CXX_ERROR(logger_, "Adapter already exists."); LOG4CXX_TRACE(logger_, - "exit with E_ADAPTER_EXISTS. Condition: transport_adapter_listeners_.find(transport_adapter) != transport_adapter_listeners_.end()"); + "exit with E_ADAPTER_EXISTS. Condition: " + "transport_adapter_listeners_.find(transport_adapter) != " + "transport_adapter_listeners_.end()"); return E_ADAPTER_EXISTS; } transport_adapter_listeners_[transport_adapter] = - new TransportAdapterListenerImpl(this, transport_adapter); + new TransportAdapterListenerImpl(this, transport_adapter); transport_adapter->AddListener( - transport_adapter_listeners_[transport_adapter]); + transport_adapter_listeners_[transport_adapter]); if (transport_adapter->IsInitialised() || transport_adapter->Init() == TransportAdapter::OK) { @@ -373,8 +402,9 @@ int TransportManagerImpl::SearchDevices() { LOG4CXX_TRACE(logger_, "enter"); if (!this->is_initialized_) { LOG4CXX_ERROR(logger_, "TM is not initialized"); - LOG4CXX_TRACE(logger_, - "exit with E_TM_IS_NOT_INITIALIZED. Condition: !this->is_initialized_"); + LOG4CXX_TRACE( + logger_, + "exit with E_TM_IS_NOT_INITIALIZED. Condition: !this->is_initialized_"); return E_TM_IS_NOT_INITIALIZED; } @@ -383,28 +413,30 @@ int TransportManagerImpl::SearchDevices() { bool success_occurred = false; for (std::vector<TransportAdapter*>::iterator it = - transport_adapters_.begin(); - it != transport_adapters_.end(); ++it) { + transport_adapters_.begin(); + it != transport_adapters_.end(); + ++it) { LOG4CXX_DEBUG(logger_, "Iterating over transport adapters"); TransportAdapter::Error scanResult = (*it)->SearchDevices(); if (transport_adapter::TransportAdapter::OK == scanResult) { success_occurred = true; } else { - LOG4CXX_ERROR(logger_, "Transport Adapter search failed " - << *it << "[" << (*it)->GetDeviceType() - << "]"); + LOG4CXX_ERROR(logger_, + "Transport Adapter search failed " + << *it << "[" << (*it)->GetDeviceType() << "]"); switch (scanResult) { case transport_adapter::TransportAdapter::NOT_SUPPORTED: { - LOG4CXX_ERROR(logger_, "Search feature is not supported " - << *it << "[" << (*it)->GetDeviceType() - << "]"); - LOG4CXX_DEBUG(logger_, "scanResult = TransportAdapter::NOT_SUPPORTED"); + LOG4CXX_ERROR(logger_, + "Search feature is not supported " + << *it << "[" << (*it)->GetDeviceType() << "]"); + LOG4CXX_DEBUG(logger_, + "scanResult = TransportAdapter::NOT_SUPPORTED"); break; } case transport_adapter::TransportAdapter::BAD_STATE: { - LOG4CXX_ERROR(logger_, "Transport Adapter has bad state " << *it << "[" << - (*it)->GetDeviceType() - << "]"); + LOG4CXX_ERROR(logger_, + "Transport Adapter has bad state " + << *it << "[" << (*it)->GetDeviceType() << "]"); LOG4CXX_DEBUG(logger_, "scanResult = TransportAdapter::BAD_STATE"); break; } @@ -416,26 +448,28 @@ int TransportManagerImpl::SearchDevices() { } } } - int transport_adapter_search = (success_occurred || transport_adapters_.empty()) - ? E_SUCCESS - : E_ADAPTERS_FAIL; + int transport_adapter_search = + (success_occurred || transport_adapters_.empty()) ? E_SUCCESS + : E_ADAPTERS_FAIL; if (transport_adapter_search == E_SUCCESS) { LOG4CXX_TRACE(logger_, - "exit with E_SUCCESS. Condition: success_occured || transport_adapters_.empty()"); + "exit with E_SUCCESS. Condition: success_occured || " + "transport_adapters_.empty()"); } else { LOG4CXX_TRACE(logger_, - "exit with E_ADAPTERS_FAIL. Condition: success_occured || transport_adapters_.empty()"); + "exit with E_ADAPTERS_FAIL. Condition: success_occured || " + "transport_adapters_.empty()"); } return transport_adapter_search; } -int TransportManagerImpl::Init(resumption::LastState &last_state) { - // Last state requred to initialize Transport adapters - UNUSED(last_state); - LOG4CXX_TRACE(logger_, "enter"); - is_initialized_ = true; - LOG4CXX_TRACE(logger_, "exit with E_SUCCESS"); - return E_SUCCESS; +int TransportManagerImpl::Init(resumption::LastState& last_state) { + // Last state requred to initialize Transport adapters + UNUSED(last_state); + LOG4CXX_TRACE(logger_, "enter"); + is_initialized_ = true; + LOG4CXX_TRACE(logger_, "exit with E_SUCCESS"); + return E_SUCCESS; } int TransportManagerImpl::Reinit() { @@ -454,21 +488,24 @@ int TransportManagerImpl::Visibility(const bool& on_off) const { if (!is_initialized_) { LOG4CXX_ERROR(logger_, "TM is not initialized"); LOG4CXX_TRACE(logger_, - "exit with E_TM_IS_NOT_INITIALIZED. Condition: false == is_initialized_"); + "exit with E_TM_IS_NOT_INITIALIZED. Condition: false == " + "is_initialized_"); return E_TM_IS_NOT_INITIALIZED; } for (std::vector<TransportAdapter*>::const_iterator it = - transport_adapters_.begin(); - it != transport_adapters_.end(); ++it) { + transport_adapters_.begin(); + it != transport_adapters_.end(); + ++it) { if (on_off) { ret = (*it)->StartClientListening(); } else { ret = (*it)->StopClientListening(); } if (TransportAdapter::Error::NOT_SUPPORTED == ret) { - LOG4CXX_DEBUG(logger_, "Visibility change is not supported for adapter " - << *it << "[" << (*it)->GetDeviceType() << "]"); + LOG4CXX_DEBUG(logger_, + "Visibility change is not supported for adapter " + << *it << "[" << (*it)->GetDeviceType() << "]"); } } LOG4CXX_TRACE(logger_, "exit with E_SUCCESS"); @@ -480,30 +517,33 @@ void TransportManagerImpl::UpdateDeviceList(TransportAdapter* ta) { std::set<DeviceInfo> old_devices; std::set<DeviceInfo> new_devices; { - sync_primitives::AutoWriteLock lock(device_list_lock_); - for (DeviceInfoList::iterator it = device_list_.begin(); - it != device_list_.end();) { - if (it->first == ta) { - old_devices.insert(it->second); - it = device_list_.erase(it); - } else { - ++it; + sync_primitives::AutoWriteLock lock(device_list_lock_); + for (DeviceInfoList::iterator it = device_list_.begin(); + it != device_list_.end();) { + if (it->first == ta) { + old_devices.insert(it->second); + it = device_list_.erase(it); + } else { + ++it; + } } - } - const DeviceList dev_list = ta->GetDeviceList(); - for (DeviceList::const_iterator it = dev_list.begin(); - it != dev_list.end(); ++it) { - DeviceHandle device_handle = converter_.UidToHandle(*it); - DeviceInfo info(device_handle, *it, ta->DeviceName(*it), ta->GetConnectionType()); - device_list_.push_back(std::make_pair(ta, info)); - new_devices.insert(info); - } + const DeviceList dev_list = ta->GetDeviceList(); + for (DeviceList::const_iterator it = dev_list.begin(); it != dev_list.end(); + ++it) { + DeviceHandle device_handle = converter_.UidToHandle(*it); + DeviceInfo info( + device_handle, *it, ta->DeviceName(*it), ta->GetConnectionType()); + device_list_.push_back(std::make_pair(ta, info)); + new_devices.insert(info); + } } std::set<DeviceInfo> added_devices; - std::set_difference(new_devices.begin(), new_devices.end(), - old_devices.begin(), old_devices.end(), + std::set_difference(new_devices.begin(), + new_devices.end(), + old_devices.begin(), + old_devices.end(), std::inserter(added_devices, added_devices.begin())); for (std::set<DeviceInfo>::const_iterator it = added_devices.begin(); it != added_devices.end(); @@ -512,8 +552,10 @@ void TransportManagerImpl::UpdateDeviceList(TransportAdapter* ta) { } std::set<DeviceInfo> removed_devices; - std::set_difference(old_devices.begin(), old_devices.end(), - new_devices.begin(), new_devices.end(), + std::set_difference(old_devices.begin(), + old_devices.end(), + new_devices.begin(), + new_devices.end(), std::inserter(removed_devices, removed_devices.begin())); for (std::set<DeviceInfo>::const_iterator it = removed_devices.begin(); @@ -524,7 +566,8 @@ void TransportManagerImpl::UpdateDeviceList(TransportAdapter* ta) { LOG4CXX_TRACE(logger_, "exit"); } -void TransportManagerImpl::PostMessage(const ::protocol_handler::RawMessagePtr message) { +void TransportManagerImpl::PostMessage( + const ::protocol_handler::RawMessagePtr message) { LOG4CXX_TRACE(logger_, "enter. RawMessageSptr: " << message); message_queue_.PostMessage(message); LOG4CXX_TRACE(logger_, "exit"); @@ -541,7 +584,7 @@ const TransportManagerSettings& TransportManagerImpl::get_settings() const { } void TransportManagerImpl::AddConnection(const ConnectionInternal& c) { - LOG4CXX_AUTO_TRACE(logger_); + LOG4CXX_AUTO_TRACE(logger_); LOG4CXX_DEBUG(logger_, "ConnectionInternal: " << &c); sync_primitives::AutoWriteLock lock(connections_lock_); connections_.push_back(c); @@ -552,7 +595,8 @@ void TransportManagerImpl::RemoveConnection(uint32_t id) { LOG4CXX_DEBUG(logger_, "Id: " << id); sync_primitives::AutoWriteLock lock(connections_lock_); for (std::vector<ConnectionInternal>::iterator it = connections_.begin(); - it != connections_.end(); ++it) { + it != connections_.end(); + ++it) { if (it->id == id) { connections_.erase(it); break; @@ -561,11 +605,12 @@ void TransportManagerImpl::RemoveConnection(uint32_t id) { } TransportManagerImpl::ConnectionInternal* TransportManagerImpl::GetConnection( - const ConnectionUID id) { + const ConnectionUID id) { LOG4CXX_AUTO_TRACE(logger_); LOG4CXX_DEBUG(logger_, "ConnectionUID: " << &id); for (std::vector<ConnectionInternal>::iterator it = connections_.begin(); - it != connections_.end(); ++it) { + it != connections_.end(); + ++it) { if (it->id == id) { LOG4CXX_DEBUG(logger_, "ConnectionInternal. It's address: " << &*it); return &*it; @@ -575,12 +620,14 @@ TransportManagerImpl::ConnectionInternal* TransportManagerImpl::GetConnection( } TransportManagerImpl::ConnectionInternal* TransportManagerImpl::GetConnection( - const DeviceUID& device, const ApplicationHandle& application) { + const DeviceUID& device, const ApplicationHandle& application) { LOG4CXX_AUTO_TRACE(logger_); - LOG4CXX_DEBUG(logger_, "DeviceUID: " << &device << "ApplicationHandle: " << - &application); + LOG4CXX_DEBUG(logger_, + "DeviceUID: " << &device + << "ApplicationHandle: " << &application); for (std::vector<ConnectionInternal>::iterator it = connections_.begin(); - it != connections_.end(); ++it) { + it != connections_.end(); + ++it) { if (it->device == device && it->application == application) { LOG4CXX_DEBUG(logger_, "ConnectionInternal. It's address: " << &*it); return &*it; @@ -594,19 +641,22 @@ void TransportManagerImpl::OnDeviceListUpdated(TransportAdapter* ta) { const DeviceList device_list = ta->GetDeviceList(); LOG4CXX_DEBUG(logger_, "DEVICE_LIST_UPDATED " << device_list.size()); for (DeviceList::const_iterator it = device_list.begin(); - it != device_list.end(); ++it) { + it != device_list.end(); + ++it) { device_to_adapter_map_lock_.AcquireForWriting(); device_to_adapter_map_.insert(std::make_pair(*it, ta)); device_to_adapter_map_lock_.Release(); DeviceHandle device_handle = converter_.UidToHandle(*it); - DeviceInfo info(device_handle, *it, ta->DeviceName(*it), ta->GetConnectionType()); + DeviceInfo info( + device_handle, *it, ta->DeviceName(*it), ta->GetConnectionType()); RaiseEvent(&TransportManagerListener::OnDeviceFound, info); } UpdateDeviceList(ta); std::vector<DeviceInfo> device_infos; device_list_lock_.AcquireForReading(); for (DeviceInfoList::const_iterator it = device_list_.begin(); - it != device_list_.end(); ++it) { + it != device_list_.end(); + ++it) { device_infos.push_back(it->second); } device_list_lock_.Release(); @@ -640,24 +690,32 @@ void TransportManagerImpl::Handle(TransportAdapterEvent event) { break; } case TransportAdapterListenerImpl::EventTypeEnum::ON_CONNECT_DONE: { - const DeviceHandle device_handle = converter_.UidToHandle(event.device_uid); - AddConnection(ConnectionInternal(this, event.transport_adapter, ++connection_id_counter_, - event.device_uid, event.application_id, + const DeviceHandle device_handle = + converter_.UidToHandle(event.device_uid); + AddConnection(ConnectionInternal(this, + event.transport_adapter, + ++connection_id_counter_, + event.device_uid, + event.application_id, device_handle)); - RaiseEvent(&TransportManagerListener::OnConnectionEstablished, - DeviceInfo(device_handle, event.device_uid, - event.transport_adapter->DeviceName(event.device_uid), - event.transport_adapter->GetConnectionType()), - connection_id_counter_); + RaiseEvent( + &TransportManagerListener::OnConnectionEstablished, + DeviceInfo(device_handle, + event.device_uid, + event.transport_adapter->DeviceName(event.device_uid), + event.transport_adapter->GetConnectionType()), + connection_id_counter_); LOG4CXX_DEBUG(logger_, "event_type = ON_CONNECT_DONE"); break; } case TransportAdapterListenerImpl::EventTypeEnum::ON_CONNECT_FAIL: { - RaiseEvent(&TransportManagerListener::OnConnectionFailed, - DeviceInfo(converter_.UidToHandle(event.device_uid), event.device_uid, - event.transport_adapter->DeviceName(event.device_uid), - event.transport_adapter->GetConnectionType()), - ConnectError()); + RaiseEvent( + &TransportManagerListener::OnConnectionFailed, + DeviceInfo(converter_.UidToHandle(event.device_uid), + event.device_uid, + event.transport_adapter->DeviceName(event.device_uid), + event.transport_adapter->GetConnectionType()), + ConnectError()); LOG4CXX_DEBUG(logger_, "event_type = ON_CONNECT_FAIL"); break; } @@ -681,9 +739,11 @@ void TransportManagerImpl::Handle(TransportAdapterEvent event) { break; } case TransportAdapterListenerImpl::EventTypeEnum::ON_DISCONNECT_FAIL: { - const DeviceHandle device_handle = converter_.UidToHandle(event.device_uid); + const DeviceHandle device_handle = + converter_.UidToHandle(event.device_uid); RaiseEvent(&TransportManagerListener::OnDisconnectFailed, - device_handle, DisconnectDeviceError()); + device_handle, + DisconnectDeviceError()); LOG4CXX_DEBUG(logger_, "event_type = ON_DISCONNECT_FAIL"); break; } @@ -697,18 +757,19 @@ void TransportManagerImpl::Handle(TransportAdapterEvent event) { ConnectionInternal* connection = GetConnection(event.device_uid, event.application_id); if (connection == NULL) { - LOG4CXX_ERROR(logger_, "Connection ('" << event.device_uid << ", " - << event.application_id - << ") not found"); - LOG4CXX_DEBUG(logger_, - "event_type = ON_SEND_DONE. Condition: NULL == connection"); + LOG4CXX_ERROR(logger_, + "Connection ('" << event.device_uid << ", " + << event.application_id << ") not found"); + LOG4CXX_DEBUG( + logger_, + "event_type = ON_SEND_DONE. Condition: NULL == connection"); break; } RaiseEvent(&TransportManagerListener::OnTMMessageSend, event.event_data); if (connection->shutdown_ && --connection->messages_count == 0) { connection->timer->Stop(); connection->transport_adapter->Disconnect(connection->device, - connection->application); + connection->application); } LOG4CXX_DEBUG(logger_, "event_type = ON_SEND_DONE"); break; @@ -720,17 +781,19 @@ void TransportManagerImpl::Handle(TransportAdapterEvent event) { } #endif // TELEMETRY_MONITOR { - sync_primitives::AutoReadLock lock(connections_lock_); - ConnectionInternal* connection = - GetConnection(event.device_uid, event.application_id); - if (connection == NULL) { - LOG4CXX_ERROR(logger_, "Connection ('" << event.device_uid << ", " - << event.application_id - << ") not found"); - LOG4CXX_DEBUG(logger_, - "event_type = ON_SEND_FAIL. Condition: NULL == connection"); - break; - } + sync_primitives::AutoReadLock lock(connections_lock_); + ConnectionInternal* connection = + GetConnection(event.device_uid, event.application_id); + if (connection == NULL) { + LOG4CXX_ERROR(logger_, + "Connection ('" << event.device_uid << ", " + << event.application_id + << ") not found"); + LOG4CXX_DEBUG( + logger_, + "event_type = ON_SEND_FAIL. Condition: NULL == connection"); + break; + } } // TODO(YK): start timer here to wait before notify caller @@ -748,25 +811,28 @@ void TransportManagerImpl::Handle(TransportAdapterEvent event) { } case TransportAdapterListenerImpl::EventTypeEnum::ON_RECEIVED_DONE: { { - sync_primitives::AutoReadLock lock(connections_lock_); - ConnectionInternal* connection = - GetConnection(event.device_uid, event.application_id); - if (connection == NULL) { - LOG4CXX_ERROR(logger_, "Connection ('" << event.device_uid << ", " - << event.application_id - << ") not found"); - LOG4CXX_DEBUG(logger_, - "event_type = ON_RECEIVED_DONE. Condition: NULL == connection"); - break; - } - event.event_data->set_connection_key(connection->id); + sync_primitives::AutoReadLock lock(connections_lock_); + ConnectionInternal* connection = + GetConnection(event.device_uid, event.application_id); + if (connection == NULL) { + LOG4CXX_ERROR(logger_, + "Connection ('" << event.device_uid << ", " + << event.application_id + << ") not found"); + LOG4CXX_DEBUG( + logger_, + "event_type = ON_RECEIVED_DONE. Condition: NULL == connection"); + break; + } + event.event_data->set_connection_key(connection->id); } #ifdef TELEMETRY_MONITOR if (metric_observer_) { metric_observer_->StopRawMsg(event.event_data.get()); } #endif // TELEMETRY_MONITOR - RaiseEvent(&TransportManagerListener::OnTMMessageReceived, event.event_data); + RaiseEvent(&TransportManagerListener::OnTMMessageReceived, + event.event_data); LOG4CXX_DEBUG(logger_, "event_type = ON_RECEIVED_DONE"); break; } @@ -776,9 +842,9 @@ void TransportManagerImpl::Handle(TransportAdapterEvent event) { ConnectionInternal* connection = GetConnection(event.device_uid, event.application_id); if (connection == NULL) { - LOG4CXX_ERROR(logger_, "Connection ('" << event.device_uid << ", " - << event.application_id - << ") not found"); + LOG4CXX_ERROR(logger_, + "Connection ('" << event.device_uid << ", " + << event.application_id << ") not found"); connections_lock_.Release(); break; } @@ -793,7 +859,8 @@ void TransportManagerImpl::Handle(TransportAdapterEvent event) { LOG4CXX_DEBUG(logger_, "event_type = ON_COMMUNICATION_ERROR"); break; } - case TransportAdapterListenerImpl::EventTypeEnum::ON_UNEXPECTED_DISCONNECT: { + case TransportAdapterListenerImpl::EventTypeEnum:: + ON_UNEXPECTED_DISCONNECT: { connections_lock_.AcquireForReading(); ConnectionInternal* connection = GetConnection(event.device_uid, event.application_id); @@ -806,9 +873,9 @@ void TransportManagerImpl::Handle(TransportAdapterEvent event) { RemoveConnection(id); } else { connections_lock_.Release(); - LOG4CXX_ERROR(logger_, "Connection ('" << event.device_uid << ", " - << event.application_id - << ") not found"); + LOG4CXX_ERROR(logger_, + "Connection ('" << event.device_uid << ", " + << event.application_id << ") not found"); } LOG4CXX_DEBUG(logger_, "eevent_type = ON_UNEXPECTED_DISCONNECT"); break; @@ -828,29 +895,30 @@ void TransportManagerImpl::Handle(::protocol_handler::RawMessagePtr msg) { sync_primitives::AutoReadLock lock(connections_lock_); ConnectionInternal* connection = GetConnection(msg->connection_key()); if (connection == NULL) { - LOG4CXX_WARN(logger_, "Connection " << msg->connection_key() << " not found"); + LOG4CXX_WARN(logger_, + "Connection " << msg->connection_key() << " not found"); RaiseEvent(&TransportManagerListener::OnTMMessageSendFailed, - DataSendTimeoutError(), msg); + DataSendTimeoutError(), + msg); return; } TransportAdapter* transport_adapter = connection->transport_adapter; - LOG4CXX_DEBUG(logger_, "Got adapter " - << transport_adapter << "[" - << transport_adapter->GetDeviceType() << "]" - << " by session id " - << msg->connection_key()); + LOG4CXX_DEBUG(logger_, + "Got adapter " << transport_adapter << "[" + << transport_adapter->GetDeviceType() << "]" + << " by session id " << msg->connection_key()); if (NULL == transport_adapter) { - std::string error_text = - "Transport adapter is not found"; + std::string error_text = "Transport adapter is not found"; LOG4CXX_ERROR(logger_, error_text); RaiseEvent(&TransportManagerListener::OnTMMessageSendFailed, - DataSendError(error_text), msg); + DataSendError(error_text), + msg); } else { if (TransportAdapter::OK == transport_adapter->SendData( - connection->device, connection->application, msg)) { + connection->device, connection->application, msg)) { LOG4CXX_TRACE(logger_, "Data sent to adapter"); } else { LOG4CXX_ERROR(logger_, "Data sent error"); @@ -871,7 +939,9 @@ TransportManagerImpl::ConnectionInternal::ConnectionInternal( const DeviceHandle device_handle) : transport_manager(transport_manager) , transport_adapter(transport_adapter) - , timer(utils::MakeShared<timer::Timer, const char*, ::timer::TimerTaskImpl<ConnectionInternal>*>( + , timer(utils::MakeShared<timer::Timer, + const char*, + ::timer::TimerTaskImpl<ConnectionInternal>*>( "TM DiscRoutine", new ::timer::TimerTaskImpl<ConnectionInternal>( this, &ConnectionInternal::DisconnectFailedRoutine))) @@ -886,12 +956,11 @@ TransportManagerImpl::ConnectionInternal::ConnectionInternal( void TransportManagerImpl::ConnectionInternal::DisconnectFailedRoutine() { LOG4CXX_TRACE(logger_, "enter"); transport_manager->RaiseEvent(&TransportManagerListener::OnDisconnectFailed, - device_handle_, DisconnectDeviceError()); + device_handle_, + DisconnectDeviceError()); shutdown_ = false; timer->Stop(); LOG4CXX_TRACE(logger_, "exit"); } } // namespace transport_manager - - diff --git a/src/components/transport_manager/src/usb/usb_aoa_adapter.cc b/src/components/transport_manager/src/usb/usb_aoa_adapter.cc index 46f5fd8ec3..3462b557ce 100644 --- a/src/components/transport_manager/src/usb/usb_aoa_adapter.cc +++ b/src/components/transport_manager/src/usb/usb_aoa_adapter.cc @@ -48,12 +48,13 @@ UsbAoaAdapter::UsbAoaAdapter(resumption::LastState& last_state, : TransportAdapterImpl(new UsbDeviceScanner(this), new UsbConnectionFactory(this), NULL, - last_state, settings) + last_state, + settings) , is_initialised_(false) , usb_handler_(new UsbHandler()) { static_cast<UsbDeviceScanner*>(device_scanner_)->SetUsbHandler(usb_handler_); static_cast<UsbConnectionFactory*>(server_connection_factory_) - ->SetUsbHandler(usb_handler_); + ->SetUsbHandler(usb_handler_); } UsbAoaAdapter::~UsbAoaAdapter() {} @@ -70,14 +71,16 @@ TransportAdapter::Error UsbAoaAdapter::Init() { LOG4CXX_TRACE(logger_, "enter"); TransportAdapter::Error error = usb_handler_->Init(); if (error != TransportAdapter::OK) { - LOG4CXX_TRACE(logger_, "exit with error " << error << - ". Condition: error != TransportAdapter::OK"); + LOG4CXX_TRACE(logger_, + "exit with error " + << error << ". Condition: error != TransportAdapter::OK"); return error; } error = TransportAdapterImpl::Init(); if (error != TransportAdapter::OK) { - LOG4CXX_TRACE(logger_, "exit with error " << error << - ". Condition: error != TransportAdapter::OK"); + LOG4CXX_TRACE(logger_, + "exit with error " + << error << ". Condition: error != TransportAdapter::OK"); return error; } is_initialised_ = true; diff --git a/src/components/transport_manager/test/include/transport_manager/connection_mock.h b/src/components/transport_manager/test/include/transport_manager/connection_mock.h index 8c8bc7c1f4..fbcfcb2271 100644 --- a/src/components/transport_manager/test/include/transport_manager/connection_mock.h +++ b/src/components/transport_manager/test/include/transport_manager/connection_mock.h @@ -44,8 +44,9 @@ using namespace ::transport_manager::transport_adapter; class MockConnection : public Connection { public: - MOCK_METHOD1(SendData, TransportAdapter::Error( - ::protocol_handler::RawMessagePtr message)); + MOCK_METHOD1( + SendData, + TransportAdapter::Error(::protocol_handler::RawMessagePtr message)); MOCK_METHOD0(Disconnect, TransportAdapter::Error()); }; diff --git a/src/components/transport_manager/test/include/transport_manager/mock_telemetry_observer.h b/src/components/transport_manager/test/include/transport_manager/mock_telemetry_observer.h index e2c41f658e..9d4e86728b 100644 --- a/src/components/transport_manager/test/include/transport_manager/mock_telemetry_observer.h +++ b/src/components/transport_manager/test/include/transport_manager/mock_telemetry_observer.h @@ -43,10 +43,8 @@ namespace transport_manager_test { class MockTMTelemetryObserver : public ::transport_manager::TMTelemetryObserver { public: - MOCK_METHOD1(StartRawMsg, - void(const protocol_handler::RawMessage* ptr)); - MOCK_METHOD1(StopRawMsg, - void(const protocol_handler::RawMessage* ptr)); + MOCK_METHOD1(StartRawMsg, void(const protocol_handler::RawMessage* ptr)); + MOCK_METHOD1(StopRawMsg, void(const protocol_handler::RawMessage* ptr)); }; } // transport_manager_test diff --git a/src/components/transport_manager/test/include/transport_manager/mock_transport_adapter_listener.h b/src/components/transport_manager/test/include/transport_manager/mock_transport_adapter_listener.h index e94e38e6d5..c6862c19d6 100644 --- a/src/components/transport_manager/test/include/transport_manager/mock_transport_adapter_listener.h +++ b/src/components/transport_manager/test/include/transport_manager/mock_transport_adapter_listener.h @@ -52,41 +52,75 @@ using namespace ::protocol_handler; class MockTransportAdapterListener : public TransportAdapterListener { public: MOCK_METHOD1(OnSearchDeviceDone, - void(const TransportAdapter* transport_adapter)); - MOCK_METHOD0(AckDevices,void()); + void(const TransportAdapter* transport_adapter)); + MOCK_METHOD0(AckDevices, void()); MOCK_METHOD2(OnSearchDeviceFailed, - void(const TransportAdapter* transport_adapter, const SearchDeviceError& error)); + void(const TransportAdapter* transport_adapter, + const SearchDeviceError& error)); MOCK_METHOD1(OnFindNewApplicationsRequest, - void(const TransportAdapter* adapter)); + void(const TransportAdapter* adapter)); MOCK_METHOD1(OnDeviceListUpdated, - void(const TransportAdapter* transport_adapter)); + void(const TransportAdapter* transport_adapter)); MOCK_METHOD3(OnConnectDone, - void(const TransportAdapter* transport_adapter, const DeviceUID& device_handle, const ApplicationHandle& app_handle)); + void(const TransportAdapter* transport_adapter, + const DeviceUID& device_handle, + const ApplicationHandle& app_handle)); MOCK_METHOD4(OnConnectFailed, - void(const TransportAdapter* transport_adapter, const DeviceUID& device_handle, const ApplicationHandle& app_handle, const ConnectError& error)); + void(const TransportAdapter* transport_adapter, + const DeviceUID& device_handle, + const ApplicationHandle& app_handle, + const ConnectError& error)); MOCK_METHOD4(OnUnexpectedDisconnect, - void(const TransportAdapter* transport_adapter, const DeviceUID& device_handle, const ApplicationHandle& app_handle, const CommunicationError& error)); + void(const TransportAdapter* transport_adapter, + const DeviceUID& device_handle, + const ApplicationHandle& app_handle, + const CommunicationError& error)); MOCK_METHOD3(OnDisconnectDone, - void(const TransportAdapter* transport_adapter, const DeviceUID& device_handle, const ApplicationHandle& app_handle)); + void(const TransportAdapter* transport_adapter, + const DeviceUID& device_handle, + const ApplicationHandle& app_handle)); MOCK_METHOD4(OnDisconnectFailed, - void(const TransportAdapter* transport_adapter, const DeviceUID& device_handle, const ApplicationHandle& app_handle, const DisconnectError& error)); + void(const TransportAdapter* transport_adapter, + const DeviceUID& device_handle, + const ApplicationHandle& app_handle, + const DisconnectError& error)); MOCK_METHOD2(OnDisconnectDeviceDone, - void(const TransportAdapter* transport_adapter, const DeviceUID& device_handle)); + void(const TransportAdapter* transport_adapter, + const DeviceUID& device_handle)); MOCK_METHOD3(OnDisconnectDeviceFailed, - void(const TransportAdapter* transport_adapter, const DeviceUID& device_handle, const DisconnectDeviceError& error)); + void(const TransportAdapter* transport_adapter, + const DeviceUID& device_handle, + const DisconnectDeviceError& error)); MOCK_METHOD4(OnDataSendDone, - void(const TransportAdapter* transport_adapter, const DeviceUID& device_handle, const ApplicationHandle& app_handle, const RawMessagePtr data_container)); + void(const TransportAdapter* transport_adapter, + const DeviceUID& device_handle, + const ApplicationHandle& app_handle, + const RawMessagePtr data_container)); MOCK_METHOD5(OnDataSendFailed, - void(const TransportAdapter* transport_adapter, const DeviceUID& device_handle, const ApplicationHandle& app_handle, const RawMessagePtr data_container, const DataSendError& error)); + void(const TransportAdapter* transport_adapter, + const DeviceUID& device_handle, + const ApplicationHandle& app_handle, + const RawMessagePtr data_container, + const DataSendError& error)); MOCK_METHOD4(OnDataReceiveDone, - void(const TransportAdapter* transport_adapter, const DeviceUID& device_handle, const ApplicationHandle& app_handle, const RawMessagePtr data_container)); + void(const TransportAdapter* transport_adapter, + const DeviceUID& device_handle, + const ApplicationHandle& app_handle, + const RawMessagePtr data_container)); MOCK_METHOD4(OnDataReceiveFailed, - void(const TransportAdapter* transport_adapter, const DeviceUID& device_handle, const ApplicationHandle& app_handle, const DataReceiveError& error)); + void(const TransportAdapter* transport_adapter, + const DeviceUID& device_handle, + const ApplicationHandle& app_handle, + const DataReceiveError& error)); MOCK_METHOD3(OnCommunicationError, - void(const TransportAdapter* transport_adapter, const DeviceUID& device_handle, const ApplicationHandle& app_handle)); - MOCK_METHOD3(OnConnectRequested, void(const TransportAdapter*, const DeviceUID&, const ApplicationHandle&)); + void(const TransportAdapter* transport_adapter, + const DeviceUID& device_handle, + const ApplicationHandle& app_handle)); + MOCK_METHOD3(OnConnectRequested, + void(const TransportAdapter*, + const DeviceUID&, + const ApplicationHandle&)); }; - } } } diff --git a/src/components/transport_manager/test/include/transport_manager/mock_transport_manager_impl.h b/src/components/transport_manager/test/include/transport_manager/mock_transport_manager_impl.h index 6d499b71c1..e94586a856 100644 --- a/src/components/transport_manager/test/include/transport_manager/mock_transport_manager_impl.h +++ b/src/components/transport_manager/test/include/transport_manager/mock_transport_manager_impl.h @@ -46,13 +46,13 @@ namespace transport_manager_test { class MockTransportManagerImpl : public ::transport_manager::TransportManagerImpl { public: - - explicit MockTransportManagerImpl(MockTransportManagerSettings& settings): - ::transport_manager::TransportManagerImpl(settings) {} + explicit MockTransportManagerImpl(MockTransportManagerSettings& settings) + : ::transport_manager::TransportManagerImpl(settings) {} int TestReceiveEventFromDevice( const ::transport_manager::TransportAdapterEvent& event) { - return ::transport_manager::TransportManagerImpl::ReceiveEventFromDevice(event); + return ::transport_manager::TransportManagerImpl::ReceiveEventFromDevice( + event); } void TestHandle(::transport_manager::TransportAdapterEvent test_event) { diff --git a/src/components/transport_manager/test/include/transport_manager/raw_message_matcher.h b/src/components/transport_manager/test/include/transport_manager/raw_message_matcher.h index 89f1cdd182..8f20afff60 100644 --- a/src/components/transport_manager/test/include/transport_manager/raw_message_matcher.h +++ b/src/components/transport_manager/test/include/transport_manager/raw_message_matcher.h @@ -56,7 +56,7 @@ class RawMessageMatcher : public MatcherInterface<RawMessagePtr> { explicit RawMessageMatcher(RawMessagePtr ptr); virtual bool MatchAndExplain(const RawMessagePtr ptr, - MatchResultListener* listener) const; + MatchResultListener* listener) const; virtual void DescribeTo(::std::ostream* os) const; virtual void DescribeNegationTo(::std::ostream* os) const; @@ -72,4 +72,5 @@ inline const Matcher<RawMessagePtr> RawMessageEq(RawMessagePtr msg) { } // namespace components } // namespace test -#endif /* APPLINK_TEST_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_RAW_MESSAGE_MATCHER_H_ */ +#endif /* APPLINK_TEST_COMPONENTS_TRANSPORT_MANAGER_INCLUDE_TRANSPORT_MANAGER_RAW_MESSAGE_MATCHER_H_ \ + */ diff --git a/src/components/transport_manager/test/include/transport_manager/server_connection_factory_mock.h b/src/components/transport_manager/test/include/transport_manager/server_connection_factory_mock.h index 73f0715438..795d9492fc 100644 --- a/src/components/transport_manager/test/include/transport_manager/server_connection_factory_mock.h +++ b/src/components/transport_manager/test/include/transport_manager/server_connection_factory_mock.h @@ -40,14 +40,16 @@ namespace test { namespace components { namespace transport_manager_test { -class MockServerConnectionFactory : public ::transport_manager::transport_adapter::ServerConnectionFactory { +class MockServerConnectionFactory + : public ::transport_manager::transport_adapter::ServerConnectionFactory { public: - MOCK_METHOD0(Init, ::transport_manager::transport_adapter::TransportAdapter::Error()); + MOCK_METHOD0( + Init, ::transport_manager::transport_adapter::TransportAdapter::Error()); MOCK_METHOD0(Terminate, void()); MOCK_CONST_METHOD0(IsInitialised, bool()); MOCK_METHOD2(CreateConnection, - ::transport_manager::transport_adapter::TransportAdapter::Error(const std::string&, - const int& app_handle)); + ::transport_manager::transport_adapter::TransportAdapter::Error( + const std::string&, const int& app_handle)); }; } // namespace transport_manager_test diff --git a/src/components/transport_manager/test/include/transport_manager/tcp/mock_tcp_transport_adapter.h b/src/components/transport_manager/test/include/transport_manager/tcp/mock_tcp_transport_adapter.h index f5531a8003..432e4f3fa0 100644 --- a/src/components/transport_manager/test/include/transport_manager/tcp/mock_tcp_transport_adapter.h +++ b/src/components/transport_manager/test/include/transport_manager/tcp/mock_tcp_transport_adapter.h @@ -45,9 +45,11 @@ using namespace ::transport_manager::transport_adapter; class MockTCPTransportAdapter : public TcpTransportAdapter { public: - MockTCPTransportAdapter(uint16_t port, resumption::LastState& last_state, - const transport_manager::TransportManagerSettings& settings) - : TcpTransportAdapter(port,last_state, settings) {} + MockTCPTransportAdapter( + uint16_t port, + resumption::LastState& last_state, + const transport_manager::TransportManagerSettings& settings) + : TcpTransportAdapter(port, last_state, settings) {} MOCK_CONST_METHOD2(FindEstablishedConnection, ConnectionSPtr(const DeviceUID& device_handle, const ApplicationHandle& app_handle)); @@ -56,8 +58,12 @@ class MockTCPTransportAdapter : public TcpTransportAdapter { MOCK_METHOD2(Connect, TransportAdapter::Error(const DeviceUID& device_handle, const ApplicationHandle& app_handle)); - void CallStore() { Store(); } - bool CallRestore() { return Restore(); } + void CallStore() { + Store(); + } + bool CallRestore() { + return Restore(); + } }; } // namespace transport_manager_test diff --git a/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_impl.h b/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_impl.h index 7823c37fc8..c576c3de6c 100644 --- a/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_impl.h +++ b/src/components/transport_manager/test/include/transport_manager/transport_adapter/mock_transport_adapter_impl.h @@ -52,22 +52,27 @@ namespace transport_manager_test { class MockTransportAdapterImpl : public TransportAdapterImpl { public: - MockTransportAdapterImpl(DeviceScanner* device_scanner, - ServerConnectionFactory* server_connection_factory, - ClientConnectionListener* client_connection_listener, - resumption::LastState& last_state, - const transport_manager::TransportManagerSettings& settings) - : TransportAdapterImpl(device_scanner, server_connection_factory, - client_connection_listener,last_state, settings) { - } + MockTransportAdapterImpl( + DeviceScanner* device_scanner, + ServerConnectionFactory* server_connection_factory, + ClientConnectionListener* client_connection_listener, + resumption::LastState& last_state, + const transport_manager::TransportManagerSettings& settings) + : TransportAdapterImpl(device_scanner, + server_connection_factory, + client_connection_listener, + last_state, + settings) {} ConnectionSPtr FindStatedConnection(const DeviceUID& device_handle, - const ApplicationHandle& app_handle) { + const ApplicationHandle& app_handle) { return this->FindEstablishedConnection(device_handle, app_handle); } virtual ~MockTransportAdapterImpl(){}; - virtual DeviceType GetDeviceType() const { return UNKNOWN; } + virtual DeviceType GetDeviceType() const { + return UNKNOWN; + } MOCK_CONST_METHOD0(Store, void()); MOCK_METHOD0(Restore, bool()); diff --git a/src/components/transport_manager/test/include/transport_manager/transport_adapter_controller_mock.h b/src/components/transport_manager/test/include/transport_manager/transport_adapter_controller_mock.h index c0c7155e43..1dc6839ac9 100644 --- a/src/components/transport_manager/test/include/transport_manager/transport_adapter_controller_mock.h +++ b/src/components/transport_manager/test/include/transport_manager/transport_adapter_controller_mock.h @@ -51,33 +51,42 @@ class TransportAdapterControllerMock : public TransportAdapterController { MOCK_METHOD0(FindNewApplicationsRequest, void()); MOCK_METHOD1(SearchDeviceFailed, void(const SearchDeviceError& error)); MOCK_CONST_METHOD1(FindDevice, DeviceSptr(const DeviceUID& device_handle)); - MOCK_CONST_METHOD3(FindDevice, void(ConnectionSPtr connection, - const DeviceUID& device_handle, - const ApplicationHandle& app_handle)); - MOCK_METHOD2(ConnectDone, void(const DeviceUID& device_handle, - const ApplicationHandle& app_handle)); - MOCK_METHOD3(ConnectFailed, void(const DeviceUID& device_handle, - const ApplicationHandle& app_handle, - const ConnectError& error)); - MOCK_METHOD2(ConnectionFinished, void(const DeviceUID& device_handle, - const ApplicationHandle& app_handle)); - MOCK_METHOD3(ConnectionAborted, void(const DeviceUID& device_handle, - const ApplicationHandle& app_handle, - const CommunicationError& error)); - MOCK_METHOD2(DeviceDisconnected, void(const DeviceUID& device_handle, - const DisconnectDeviceError& error)); - MOCK_METHOD2(DisconnectDone, void(const DeviceUID& device_handle, - const ApplicationHandle& app_handle)); + MOCK_CONST_METHOD3(FindDevice, + void(ConnectionSPtr connection, + const DeviceUID& device_handle, + const ApplicationHandle& app_handle)); + MOCK_METHOD2(ConnectDone, + void(const DeviceUID& device_handle, + const ApplicationHandle& app_handle)); + MOCK_METHOD3(ConnectFailed, + void(const DeviceUID& device_handle, + const ApplicationHandle& app_handle, + const ConnectError& error)); + MOCK_METHOD2(ConnectionFinished, + void(const DeviceUID& device_handle, + const ApplicationHandle& app_handle)); + MOCK_METHOD3(ConnectionAborted, + void(const DeviceUID& device_handle, + const ApplicationHandle& app_handle, + const CommunicationError& error)); + MOCK_METHOD2(DeviceDisconnected, + void(const DeviceUID& device_handle, + const DisconnectDeviceError& error)); + MOCK_METHOD2(DisconnectDone, + void(const DeviceUID& device_handle, + const ApplicationHandle& app_handle)); MOCK_METHOD3(DataReceiveDone, void(const DeviceUID& device_handle, const ApplicationHandle& app_handle, ::protocol_handler::RawMessagePtr message)); - MOCK_METHOD3(DataReceiveFailed, void(const DeviceUID& device_handle, - const ApplicationHandle& app_handle, - const DataReceiveError& error)); - MOCK_METHOD3(DataSendDone, void(const DeviceUID& device_handle, - const ApplicationHandle& app_handle, - ::protocol_handler::RawMessagePtr message)); + MOCK_METHOD3(DataReceiveFailed, + void(const DeviceUID& device_handle, + const ApplicationHandle& app_handle, + const DataReceiveError& error)); + MOCK_METHOD3(DataSendDone, + void(const DeviceUID& device_handle, + const ApplicationHandle& app_handle, + ::protocol_handler::RawMessagePtr message)); MOCK_METHOD3(DataReceiveFailed, void(const DeviceUID& device_handle, const ApplicationHandle& app_handle, diff --git a/src/components/transport_manager/test/include/transport_manager/transport_adapter_mock.h b/src/components/transport_manager/test/include/transport_manager/transport_adapter_mock.h index c50d7ce97b..ff3ebcbeec 100644 --- a/src/components/transport_manager/test/include/transport_manager/transport_adapter_mock.h +++ b/src/components/transport_manager/test/include/transport_manager/transport_adapter_mock.h @@ -93,7 +93,8 @@ class MockTransportAdapter std::string(const ::transport_manager::DeviceUID& device_handle)); #ifdef TELEMETRY_MONITOR - MOCK_METHOD0(GetTelemetryObserver, ::transport_manager::TMTelemetryObserver*()); + MOCK_METHOD0(GetTelemetryObserver, + ::transport_manager::TMTelemetryObserver*()); #endif // TELEMETRY_MONITOR }; diff --git a/src/components/transport_manager/test/include/transport_manager/transport_manager_impl_mock.h b/src/components/transport_manager/test/include/transport_manager/transport_manager_impl_mock.h index bb73f1fa49..e5b0468968 100644 --- a/src/components/transport_manager/test/include/transport_manager/transport_manager_impl_mock.h +++ b/src/components/transport_manager/test/include/transport_manager/transport_manager_impl_mock.h @@ -51,4 +51,4 @@ class TransportManagerImplMock : public TransportManagerImpl { } // namespace components } // namespace test -#endif // APPLINK_TEST_COMPONENTS_TRANSPORTMANAGER_INCLUDE_TRANSPORT_MANAGER_IMPL_MOCK_H_ +#endif // APPLINK_TEST_COMPONENTS_TRANSPORTMANAGER_INCLUDE_TRANSPORT_MANAGER_IMPL_MOCK_H_ diff --git a/src/components/transport_manager/test/include/transport_manager/transport_manager_listener_mock.h b/src/components/transport_manager/test/include/transport_manager/transport_manager_listener_mock.h index 5ae6495db2..30f602119d 100644 --- a/src/components/transport_manager/test/include/transport_manager/transport_manager_listener_mock.h +++ b/src/components/transport_manager/test/include/transport_manager/transport_manager_listener_mock.h @@ -49,41 +49,39 @@ using ::protocol_handler::RawMessagePtr; class TransportManagerListenerMock : public TransportManagerListener { public: MOCK_METHOD1(OnDeviceListUpdated, - void(const std::vector<DeviceInfo>& device_info)); - MOCK_METHOD0(OnFindNewApplicationsRequest, - void()); - MOCK_METHOD1(OnDeviceFound, - void(const DeviceInfo& device_info)); - MOCK_METHOD1(OnDeviceAdded, - void(const DeviceInfo& device_info)); - MOCK_METHOD1(OnDeviceRemoved, - void(const DeviceInfo& device_info)); - MOCK_METHOD0(OnScanDevicesFinished, - void()); - MOCK_METHOD1(OnScanDevicesFailed, - void(const SearchDeviceError& error)); + void(const std::vector<DeviceInfo>& device_info)); + MOCK_METHOD0(OnFindNewApplicationsRequest, void()); + MOCK_METHOD1(OnDeviceFound, void(const DeviceInfo& device_info)); + MOCK_METHOD1(OnDeviceAdded, void(const DeviceInfo& device_info)); + MOCK_METHOD1(OnDeviceRemoved, void(const DeviceInfo& device_info)); + MOCK_METHOD0(OnScanDevicesFinished, void()); + MOCK_METHOD1(OnScanDevicesFailed, void(const SearchDeviceError& error)); MOCK_METHOD2(OnConnectionEstablished, - void(const DeviceInfo& device_info, const ConnectionUID connection_id)); + void(const DeviceInfo& device_info, + const ConnectionUID connection_id)); MOCK_METHOD2(OnConnectionFailed, - void(const DeviceInfo& device_info, const ConnectError& error)); - MOCK_METHOD1(OnConnectionClosed, - void(const ConnectionUID connection_id)); + void(const DeviceInfo& device_info, const ConnectError& error)); + MOCK_METHOD1(OnConnectionClosed, void(const ConnectionUID connection_id)); MOCK_METHOD2(OnUnexpectedDisconnect, - void(const ConnectionUID connection_id, const CommunicationError& error)); + void(const ConnectionUID connection_id, + const CommunicationError& error)); MOCK_METHOD2(OnConnectionClosedFailure, - void(const ConnectionUID connection_id, const DisconnectError& error)); + void(const ConnectionUID connection_id, + const DisconnectError& error)); MOCK_METHOD2(OnDeviceConnectionLost, - void(const DeviceHandle& device, const DisconnectDeviceError& error)); + void(const DeviceHandle& device, + const DisconnectDeviceError& error)); MOCK_METHOD2(OnDisconnectFailed, - void(const DeviceHandle& device, const DisconnectDeviceError& error)); + void(const DeviceHandle& device, + const DisconnectDeviceError& error)); MOCK_METHOD1(OnTMMessageReceived, - void(const ::protocol_handler::RawMessagePtr message)); - MOCK_METHOD1(OnTMMessageReceiveFailed, - void(const DataReceiveError& error)); + void(const ::protocol_handler::RawMessagePtr message)); + MOCK_METHOD1(OnTMMessageReceiveFailed, void(const DataReceiveError& error)); MOCK_METHOD1(OnTMMessageSend, - void(const ::protocol_handler::RawMessagePtr message)); + void(const ::protocol_handler::RawMessagePtr message)); MOCK_METHOD2(OnTMMessageSendFailed, - void(const DataSendError& error, const ::protocol_handler::RawMessagePtr message)); + void(const DataSendError& error, + const ::protocol_handler::RawMessagePtr message)); }; } // namespace transport_manager_test diff --git a/src/components/transport_manager/test/tcp_client_listener_test.cc b/src/components/transport_manager/test/tcp_client_listener_test.cc index 48af5e5242..782b363a38 100644 --- a/src/components/transport_manager/test/tcp_client_listener_test.cc +++ b/src/components/transport_manager/test/tcp_client_listener_test.cc @@ -45,34 +45,65 @@ using ::testing::Return; using namespace ::transport_manager; using namespace ::transport_manager::transport_adapter; -class MockTransportAdapterController: public TransportAdapterController { -public: - MOCK_METHOD1(AddDevice,DeviceSptr(DeviceSptr device)); - MOCK_METHOD0(AckDevices,void()); - MOCK_METHOD1(SearchDeviceDone, void(const DeviceVector& devices)); - MOCK_METHOD1(SearchDeviceFailed, void(const SearchDeviceError& error)); - MOCK_CONST_METHOD1(FindDevice, DeviceSptr(const DeviceUID& device_handle)); - MOCK_METHOD3(ConnectionCreated, void(ConnectionSPtr connection, const DeviceUID& device_handle, const ApplicationHandle& app_handle)); - MOCK_METHOD2(ConnectDone, void(const DeviceUID& device_handle, const ApplicationHandle& app_handle)); - MOCK_METHOD3(ConnectFailed, void(const DeviceUID& device_handle, const ApplicationHandle& app_handle, const ConnectError& error)); - MOCK_METHOD2(ConnectionFinished, void(const DeviceUID& device_handle, const ApplicationHandle& app_handle)); - MOCK_METHOD3(ConnectionAborted,void(const DeviceUID& device_handle, const ApplicationHandle& app_handle, const CommunicationError& error)); - MOCK_METHOD2(DisconnectDone, void(const DeviceUID& device_handle, const ApplicationHandle& app_handle)); - MOCK_METHOD3(DataReceiveDone, void(const DeviceUID& device_handle, const ApplicationHandle& app_handle, const ::protocol_handler::RawMessagePtr message)); - MOCK_METHOD3(DataReceiveFailed, void(const DeviceUID& device_handle, const ApplicationHandle& app_handle, const DataReceiveError& error)); - MOCK_METHOD3(DataSendDone, void(const DeviceUID& device_handle, const ApplicationHandle& app_handle, const ::protocol_handler::RawMessagePtr message)); - MOCK_METHOD4(DataSendFailed, void(const DeviceUID& device_handle, const ApplicationHandle& app_handle, const ::protocol_handler::RawMessagePtr message, const DataSendError& error)); - MOCK_METHOD0(FindNewApplicationsRequest, void()); - MOCK_METHOD1(ApplicationListUpdated, void(const DeviceUID& device_handle)); - MOCK_METHOD2(DeviceDisconnected, void (const DeviceUID& device_handle,const DisconnectDeviceError& error)); +class MockTransportAdapterController : public TransportAdapterController { + public: + MOCK_METHOD1(AddDevice, DeviceSptr(DeviceSptr device)); + MOCK_METHOD0(AckDevices, void()); + MOCK_METHOD1(SearchDeviceDone, void(const DeviceVector& devices)); + MOCK_METHOD1(SearchDeviceFailed, void(const SearchDeviceError& error)); + MOCK_CONST_METHOD1(FindDevice, DeviceSptr(const DeviceUID& device_handle)); + MOCK_METHOD3(ConnectionCreated, + void(ConnectionSPtr connection, + const DeviceUID& device_handle, + const ApplicationHandle& app_handle)); + MOCK_METHOD2(ConnectDone, + void(const DeviceUID& device_handle, + const ApplicationHandle& app_handle)); + MOCK_METHOD3(ConnectFailed, + void(const DeviceUID& device_handle, + const ApplicationHandle& app_handle, + const ConnectError& error)); + MOCK_METHOD2(ConnectionFinished, + void(const DeviceUID& device_handle, + const ApplicationHandle& app_handle)); + MOCK_METHOD3(ConnectionAborted, + void(const DeviceUID& device_handle, + const ApplicationHandle& app_handle, + const CommunicationError& error)); + MOCK_METHOD2(DisconnectDone, + void(const DeviceUID& device_handle, + const ApplicationHandle& app_handle)); + MOCK_METHOD3(DataReceiveDone, + void(const DeviceUID& device_handle, + const ApplicationHandle& app_handle, + const ::protocol_handler::RawMessagePtr message)); + MOCK_METHOD3(DataReceiveFailed, + void(const DeviceUID& device_handle, + const ApplicationHandle& app_handle, + const DataReceiveError& error)); + MOCK_METHOD3(DataSendDone, + void(const DeviceUID& device_handle, + const ApplicationHandle& app_handle, + const ::protocol_handler::RawMessagePtr message)); + MOCK_METHOD4(DataSendFailed, + void(const DeviceUID& device_handle, + const ApplicationHandle& app_handle, + const ::protocol_handler::RawMessagePtr message, + const DataSendError& error)); + MOCK_METHOD0(FindNewApplicationsRequest, void()); + MOCK_METHOD1(ApplicationListUpdated, void(const DeviceUID& device_handle)); + MOCK_METHOD2(DeviceDisconnected, + void(const DeviceUID& device_handle, + const DisconnectDeviceError& error)); }; class TcpClientListenerTest : public ::testing::Test { public: TcpClientListenerTest() - : port_(0), - enable_keep_alive_(false), - tcp_client_listener_(&adapter_controller_mock_, port_, enable_keep_alive_) {} + : port_(0) + , enable_keep_alive_(false) + , tcp_client_listener_( + &adapter_controller_mock_, port_, enable_keep_alive_) {} protected: uint16_t port_; @@ -88,7 +119,7 @@ TEST_F(TcpClientListenerTest, Ctor_test) { } TEST_F(TcpClientListenerTest, IsInitialised) { - EXPECT_TRUE(tcp_client_listener_.IsInitialised()); + EXPECT_TRUE(tcp_client_listener_.IsInitialised()); } TEST_F(TcpClientListenerTest, Init) { @@ -98,4 +129,3 @@ TEST_F(TcpClientListenerTest, Init) { } // namespace transport_manager_test } // namespace components } // namespace test - diff --git a/src/components/transport_manager/test/tcp_transport_adapter_test.cc b/src/components/transport_manager/test/tcp_transport_adapter_test.cc index cb42993c13..60732f0328 100644 --- a/src/components/transport_manager/test/tcp_transport_adapter_test.cc +++ b/src/components/transport_manager/test/tcp_transport_adapter_test.cc @@ -56,17 +56,17 @@ using namespace transport_manager::transport_adapter; class TcpAdapterTest : public ::testing::Test { protected: - TcpAdapterTest():last_state_("app_storage_folder", - "app_info_storage"){} + TcpAdapterTest() : last_state_("app_storage_folder", "app_info_storage") {} MockTransportManagerSettings transport_manager_settings; - resumption::LastState last_state_; + resumption::LastState last_state_; const uint32_t port = 12345; const std::string string_port = "12345"; }; TEST_F(TcpAdapterTest, StoreDataWithOneDeviceAndOneApplication) { // Prepare - MockTCPTransportAdapter transport_adapter(port, last_state_, transport_manager_settings); + MockTCPTransportAdapter transport_adapter( + port, last_state_, transport_manager_settings); std::string uniq_id = "unique_device_name"; utils::SharedPtr<MockTCPDevice> mockdev = new MockTCPDevice(port, uniq_id); transport_adapter.AddDevice(mockdev); @@ -89,8 +89,8 @@ TEST_F(TcpAdapterTest, StoreDataWithOneDeviceAndOneApplication) { transport_adapter.CallStore(); // Check that value is saved - Json::Value& tcp_dict = last_state_ - .dictionary["TransportManager"]["TcpAdapter"]; + Json::Value& tcp_dict = + last_state_.dictionary["TransportManager"]["TcpAdapter"]; ASSERT_TRUE(tcp_dict.isObject()); ASSERT_FALSE(tcp_dict["devices"].isNull()); @@ -104,7 +104,8 @@ TEST_F(TcpAdapterTest, StoreDataWithOneDeviceAndOneApplication) { TEST_F(TcpAdapterTest, StoreDataWithSeveralDevicesAndOneApplication) { // Prepare - MockTCPTransportAdapter transport_adapter(port, last_state_, transport_manager_settings); + MockTCPTransportAdapter transport_adapter( + port, last_state_, transport_manager_settings); const uint32_t count_dev = 10; utils::SharedPtr<MockTCPDevice> mockdev[count_dev]; std::string uniq_id[count_dev]; @@ -140,8 +141,8 @@ TEST_F(TcpAdapterTest, StoreDataWithSeveralDevicesAndOneApplication) { transport_adapter.CallStore(); // Check that values are saved - Json::Value& tcp_dict = last_state_ - .dictionary["TransportManager"]["TcpAdapter"]; + Json::Value& tcp_dict = + last_state_.dictionary["TransportManager"]["TcpAdapter"]; ASSERT_TRUE(tcp_dict.isObject()); ASSERT_FALSE(tcp_dict["devices"].isNull()); for (uint32_t i = 0; i < count_dev; i++) { @@ -156,7 +157,8 @@ TEST_F(TcpAdapterTest, StoreDataWithSeveralDevicesAndOneApplication) { TEST_F(TcpAdapterTest, StoreDataWithSeveralDevicesAndSeveralApplications) { // Prepare - MockTCPTransportAdapter transport_adapter(port, last_state_, transport_manager_settings); + MockTCPTransportAdapter transport_adapter( + port, last_state_, transport_manager_settings); const uint32_t count_dev = 10; utils::SharedPtr<MockTCPDevice> mockdev[count_dev]; @@ -196,8 +198,8 @@ TEST_F(TcpAdapterTest, StoreDataWithSeveralDevicesAndSeveralApplications) { transport_adapter.CallStore(); // Check that value is saved - Json::Value& tcp_dict = last_state_ - .dictionary["TransportManager"]["TcpAdapter"]; + Json::Value& tcp_dict = + last_state_.dictionary["TransportManager"]["TcpAdapter"]; ASSERT_TRUE(tcp_dict.isObject()); ASSERT_FALSE(tcp_dict["devices"].isNull()); @@ -214,7 +216,8 @@ TEST_F(TcpAdapterTest, StoreDataWithSeveralDevicesAndSeveralApplications) { TEST_F(TcpAdapterTest, StoreData_ConnectionNotExist_DataNotStored) { // Prepare - MockTCPTransportAdapter transport_adapter(port, last_state_, transport_manager_settings); + MockTCPTransportAdapter transport_adapter( + port, last_state_, transport_manager_settings); std::string uniq_id = "unique_device_name"; utils::SharedPtr<MockTCPDevice> mockdev = new MockTCPDevice(port, uniq_id); transport_adapter.AddDevice(mockdev); @@ -233,23 +236,23 @@ TEST_F(TcpAdapterTest, StoreData_ConnectionNotExist_DataNotStored) { // Check that value is not saved Json::Value& tcp_dict = - last_state_ - .dictionary["TransportManager"]["TcpAdapter"]["devices"]; + last_state_.dictionary["TransportManager"]["TcpAdapter"]["devices"]; ASSERT_TRUE(tcp_dict.isNull()); } TEST_F(TcpAdapterTest, RestoreData_DataNotStored) { Json::Value& tcp_adapter_dictionary = - last_state_ - .dictionary["TransportManager"]["TcpAdapter"]; + last_state_.dictionary["TransportManager"]["TcpAdapter"]; tcp_adapter_dictionary = Json::Value(); - MockTCPTransportAdapter transport_adapter(port, last_state_, transport_manager_settings); + MockTCPTransportAdapter transport_adapter( + port, last_state_, transport_manager_settings); EXPECT_CALL(transport_adapter, Connect(_, _)).Times(0); EXPECT_TRUE(transport_adapter.CallRestore()); } TEST_F(TcpAdapterTest, StoreDataWithOneDevice_RestoreData) { - MockTCPTransportAdapter transport_adapter(port, last_state_, transport_manager_settings); + MockTCPTransportAdapter transport_adapter( + port, last_state_, transport_manager_settings); std::string uniq_id = "unique_device_name"; utils::SharedPtr<MockTCPDevice> mockdev = new MockTCPDevice(port, uniq_id); transport_adapter.AddDevice(mockdev); @@ -282,7 +285,8 @@ TEST_F(TcpAdapterTest, StoreDataWithOneDevice_RestoreData) { } TEST_F(TcpAdapterTest, StoreDataWithSeveralDevices_RestoreData) { - MockTCPTransportAdapter transport_adapter(port, last_state_, transport_manager_settings); + MockTCPTransportAdapter transport_adapter( + port, last_state_, transport_manager_settings); const uint32_t count_dev = 10; utils::SharedPtr<MockTCPDevice> mockdev[count_dev]; diff --git a/src/components/transport_manager/test/transport_adapter_listener_test.cc b/src/components/transport_manager/test/transport_adapter_listener_test.cc index 445e1a98b4..d56949301c 100644 --- a/src/components/transport_manager/test/transport_adapter_listener_test.cc +++ b/src/components/transport_manager/test/transport_adapter_listener_test.cc @@ -45,9 +45,9 @@ using namespace ::transport_manager; class TransportAdapterListenerTest : public ::testing::Test { public: TransportAdapterListenerTest() - : app_handle(1), - dev_id("device_id"), - transport_listener(&tr_mock, &adapter_mock) {} + : app_handle(1) + , dev_id("device_id") + , transport_listener(&tr_mock, &adapter_mock) {} protected: const int app_handle; @@ -75,7 +75,9 @@ TEST_F(TransportAdapterListenerTest, OnCommunicationError) { tr_mock, ReceiveEventFromDevice(IsEvent( TransportAdapterListenerImpl::EventTypeEnum::ON_COMMUNICATION_ERROR, - &adapter_mock, dev_id, app_handle))).WillOnce(Return(E_SUCCESS)); + &adapter_mock, + dev_id, + app_handle))).WillOnce(Return(E_SUCCESS)); transport_listener.OnCommunicationError(&adapter_mock, dev_id, app_handle); } @@ -83,8 +85,9 @@ TEST_F(TransportAdapterListenerTest, OnConnectDone) { EXPECT_CALL(tr_mock, ReceiveEventFromDevice(IsEvent( TransportAdapterListenerImpl::EventTypeEnum::ON_CONNECT_DONE, - &adapter_mock, dev_id, app_handle))) - .WillOnce(Return(E_SUCCESS)); + &adapter_mock, + dev_id, + app_handle))).WillOnce(Return(E_SUCCESS)); transport_listener.OnConnectDone(&adapter_mock, dev_id, app_handle); } @@ -94,8 +97,9 @@ TEST_F(TransportAdapterListenerTest, OnConnectFailed) { EXPECT_CALL(tr_mock, ReceiveEventFromDevice(IsEvent( TransportAdapterListenerImpl::EventTypeEnum::ON_CONNECT_FAIL, - &adapter_mock, dev_id, app_handle))) - .WillOnce(Return(E_SUCCESS)); + &adapter_mock, + dev_id, + app_handle))).WillOnce(Return(E_SUCCESS)); transport_listener.OnConnectFailed(&adapter_mock, dev_id, app_handle, er); } @@ -105,10 +109,12 @@ TEST_F(TransportAdapterListenerTest, OnDataReceiveDone) { EXPECT_CALL(tr_mock, ReceiveEventFromDevice(IsEvent( TransportAdapterListenerImpl::EventTypeEnum::ON_RECEIVED_DONE, - &adapter_mock, dev_id, app_handle, data_container))) - .WillOnce(Return(E_SUCCESS)); - transport_listener.OnDataReceiveDone(&adapter_mock, dev_id, app_handle, - data_container); + &adapter_mock, + dev_id, + app_handle, + data_container))).WillOnce(Return(E_SUCCESS)); + transport_listener.OnDataReceiveDone( + &adapter_mock, dev_id, app_handle, data_container); } TEST_F(TransportAdapterListenerTest, OnDataReceiveFailed) { @@ -117,10 +123,11 @@ TEST_F(TransportAdapterListenerTest, OnDataReceiveFailed) { EXPECT_CALL(tr_mock, ReceiveEventFromDevice(IsEvent( TransportAdapterListenerImpl::EventTypeEnum::ON_RECEIVED_FAIL, - &adapter_mock, dev_id, app_handle))) - .WillOnce(Return(E_SUCCESS)); - transport_listener.OnDataReceiveFailed(&adapter_mock, dev_id, app_handle, - err); + &adapter_mock, + dev_id, + app_handle))).WillOnce(Return(E_SUCCESS)); + transport_listener.OnDataReceiveFailed( + &adapter_mock, dev_id, app_handle, err); } TEST_F(TransportAdapterListenerTest, OnDataSendDone) { @@ -131,10 +138,12 @@ TEST_F(TransportAdapterListenerTest, OnDataSendDone) { EXPECT_CALL(tr_mock, ReceiveEventFromDevice(IsEvent( TransportAdapterListenerImpl::EventTypeEnum::ON_SEND_DONE, - &adapter_mock, dev_id, app_handle, data_container))) - .WillOnce(Return(E_SUCCESS)); - transport_listener.OnDataSendDone(&adapter_mock, dev_id, app_handle, - data_container); + &adapter_mock, + dev_id, + app_handle, + data_container))).WillOnce(Return(E_SUCCESS)); + transport_listener.OnDataSendDone( + &adapter_mock, dev_id, app_handle, data_container); } TEST_F(TransportAdapterListenerTest, OnDataSendFailed) { @@ -146,10 +155,12 @@ TEST_F(TransportAdapterListenerTest, OnDataSendFailed) { EXPECT_CALL(tr_mock, ReceiveEventFromDevice(IsEvent( TransportAdapterListenerImpl::EventTypeEnum::ON_SEND_FAIL, - &adapter_mock, dev_id, app_handle, data_container))) - .WillOnce(Return(E_SUCCESS)); - transport_listener.OnDataSendFailed(&adapter_mock, dev_id, app_handle, - data_container, err); + &adapter_mock, + dev_id, + app_handle, + data_container))).WillOnce(Return(E_SUCCESS)); + transport_listener.OnDataSendFailed( + &adapter_mock, dev_id, app_handle, data_container, err); } TEST_F(TransportAdapterListenerTest, OnDeviceListUpdated) { @@ -157,7 +168,9 @@ TEST_F(TransportAdapterListenerTest, OnDeviceListUpdated) { tr_mock, ReceiveEventFromDevice(IsEvent( TransportAdapterListenerImpl::EventTypeEnum::ON_DEVICE_LIST_UPDATED, - &adapter_mock, "", 0))).WillOnce(Return(E_SUCCESS)); + &adapter_mock, + "", + 0))).WillOnce(Return(E_SUCCESS)); transport_listener.OnDeviceListUpdated(&adapter_mock); } @@ -166,7 +179,9 @@ TEST_F(TransportAdapterListenerTest, OnDisconnectDeviceDone) { tr_mock, ReceiveEventFromDevice(IsEvent( TransportAdapterListenerImpl::EventTypeEnum::ON_DISCONNECT_DONE, - &adapter_mock, dev_id, app_handle))).WillOnce(Return(E_SUCCESS)); + &adapter_mock, + dev_id, + app_handle))).WillOnce(Return(E_SUCCESS)); transport_listener.OnDisconnectDone(&adapter_mock, dev_id, app_handle); } @@ -177,15 +192,20 @@ TEST_F(TransportAdapterListenerTest, OnDisconnectFailed) { tr_mock, ReceiveEventFromDevice(IsEvent( TransportAdapterListenerImpl::EventTypeEnum::ON_DISCONNECT_FAIL, - &adapter_mock, dev_id, app_handle))).WillOnce(Return(E_SUCCESS)); + &adapter_mock, + dev_id, + app_handle))).WillOnce(Return(E_SUCCESS)); transport_listener.OnDisconnectFailed(&adapter_mock, dev_id, app_handle, err); } TEST_F(TransportAdapterListenerTest, OnFindNewApplicationsRequest) { - EXPECT_CALL(tr_mock, ReceiveEventFromDevice(IsEvent( - TransportAdapterListenerImpl::EventTypeEnum:: - ON_FIND_NEW_APPLICATIONS_REQUEST, - &adapter_mock, "", 0))).WillOnce(Return(E_SUCCESS)); + EXPECT_CALL(tr_mock, + ReceiveEventFromDevice( + IsEvent(TransportAdapterListenerImpl::EventTypeEnum:: + ON_FIND_NEW_APPLICATIONS_REQUEST, + &adapter_mock, + "", + 0))).WillOnce(Return(E_SUCCESS)); transport_listener.OnFindNewApplicationsRequest(&adapter_mock); } @@ -193,7 +213,9 @@ TEST_F(TransportAdapterListenerTest, OnSearchDeviceDone) { EXPECT_CALL(tr_mock, ReceiveEventFromDevice(IsEvent( TransportAdapterListenerImpl::EventTypeEnum::ON_SEARCH_DONE, - &adapter_mock, "", 0))).WillOnce(Return(E_SUCCESS)); + &adapter_mock, + "", + 0))).WillOnce(Return(E_SUCCESS)); transport_listener.OnSearchDeviceDone(&adapter_mock); } @@ -203,7 +225,9 @@ TEST_F(TransportAdapterListenerTest, OnSearchDeviceFailed) { EXPECT_CALL(tr_mock, ReceiveEventFromDevice(IsEvent( TransportAdapterListenerImpl::EventTypeEnum::ON_SEARCH_FAIL, - &adapter_mock, "", 0))).WillOnce(Return(E_SUCCESS)); + &adapter_mock, + "", + 0))).WillOnce(Return(E_SUCCESS)); transport_listener.OnSearchDeviceFailed(&adapter_mock, er); } @@ -214,9 +238,11 @@ TEST_F(TransportAdapterListenerTest, OnUnexpectedDisconnect) { tr_mock, ReceiveEventFromDevice(IsEvent( TransportAdapterListenerImpl::EventTypeEnum::ON_UNEXPECTED_DISCONNECT, - &adapter_mock, dev_id, app_handle))).WillOnce(Return(E_SUCCESS)); - transport_listener.OnUnexpectedDisconnect(&adapter_mock, dev_id, app_handle, - err); + &adapter_mock, + dev_id, + app_handle))).WillOnce(Return(E_SUCCESS)); + transport_listener.OnUnexpectedDisconnect( + &adapter_mock, dev_id, app_handle, err); } } // namespace transport_manager_test diff --git a/src/components/transport_manager/test/transport_adapter_test.cc b/src/components/transport_manager/test/transport_adapter_test.cc index fc128630a7..5d34a2f02f 100644 --- a/src/components/transport_manager/test/transport_adapter_test.cc +++ b/src/components/transport_manager/test/transport_adapter_test.cc @@ -61,18 +61,19 @@ using namespace ::protocol_handler; class TransportAdapterTest : public ::testing::Test { protected: - TransportAdapterTest(): last_state_("app_storage_folder", - "app_info_storage"){} + TransportAdapterTest() + : last_state_("app_storage_folder", "app_info_storage") {} void SetUp() OVERRIDE { dev_id = "device_id"; uniq_id = "unique_device_id"; app_handle = 1; - ON_CALL(transport_manager_settings, use_last_state()).WillByDefault(Return(true)); + ON_CALL(transport_manager_settings, use_last_state()) + .WillByDefault(Return(true)); } NiceMock<MockTransportManagerSettings> transport_manager_settings; - resumption::LastState last_state_; + resumption::LastState last_state_; std::string dev_id; std::string uniq_id; int app_handle; @@ -82,7 +83,11 @@ TEST_F(TransportAdapterTest, Init) { MockDeviceScanner* dev_mock = new MockDeviceScanner(); MockClientConnectionListener* clientMock = new MockClientConnectionListener(); MockServerConnectionFactory* serverMock = new MockServerConnectionFactory(); - MockTransportAdapterImpl transport_adapter(dev_mock, serverMock, clientMock, last_state_, transport_manager_settings); + MockTransportAdapterImpl transport_adapter(dev_mock, + serverMock, + clientMock, + last_state_, + transport_manager_settings); EXPECT_CALL(*dev_mock, Init()).WillOnce(Return(TransportAdapter::OK)); EXPECT_CALL(*clientMock, Init()).WillOnce(Return(TransportAdapter::OK)); EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK)); @@ -99,7 +104,8 @@ TEST_F(TransportAdapterTest, Init) { TEST_F(TransportAdapterTest, SearchDevices_WithoutScanner) { MockClientConnectionListener* clientMock = new MockClientConnectionListener(); MockServerConnectionFactory* serverMock = new MockServerConnectionFactory(); - MockTransportAdapterImpl transport_adapter(NULL, serverMock, clientMock, last_state_, transport_manager_settings); + MockTransportAdapterImpl transport_adapter( + NULL, serverMock, clientMock, last_state_, transport_manager_settings); EXPECT_CALL(*clientMock, Init()).WillOnce(Return(TransportAdapter::OK)); EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK)); @@ -114,7 +120,8 @@ TEST_F(TransportAdapterTest, SearchDevices_WithoutScanner) { TEST_F(TransportAdapterTest, SearchDevices_DeviceNotInitialized) { MockDeviceScanner* dev_mock = new MockDeviceScanner(); - MockTransportAdapterImpl transport_adapter(dev_mock, NULL, NULL, last_state_, transport_manager_settings); + MockTransportAdapterImpl transport_adapter( + dev_mock, NULL, NULL, last_state_, transport_manager_settings); EXPECT_CALL(*dev_mock, Init()).WillOnce(Return(TransportAdapter::OK)); EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true)); @@ -128,7 +135,8 @@ TEST_F(TransportAdapterTest, SearchDevices_DeviceNotInitialized) { TEST_F(TransportAdapterTest, SearchDevices_DeviceInitialized) { MockDeviceScanner* dev_mock = new MockDeviceScanner(); - MockTransportAdapterImpl transport_adapter(dev_mock, NULL, NULL, last_state_, transport_manager_settings); + MockTransportAdapterImpl transport_adapter( + dev_mock, NULL, NULL, last_state_, transport_manager_settings); EXPECT_CALL(*dev_mock, Init()).WillOnce(Return(TransportAdapter::OK)); EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true)); @@ -142,11 +150,11 @@ TEST_F(TransportAdapterTest, SearchDevices_DeviceInitialized) { } TEST_F(TransportAdapterTest, SearchDeviceDone_DeviceExisting) { - MockTransportAdapterImpl transport_adapter(NULL, NULL, NULL, last_state_, transport_manager_settings); + MockTransportAdapterImpl transport_adapter( + NULL, NULL, NULL, last_state_, transport_manager_settings); EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true)); transport_adapter.Init(); - utils::SharedPtr<MockDevice> mockdev = new MockDevice(dev_id, uniq_id); transport_adapter.AddDevice(mockdev); @@ -158,7 +166,8 @@ TEST_F(TransportAdapterTest, SearchDeviceDone_DeviceExisting) { } TEST_F(TransportAdapterTest, SearchDeviceFailed) { - MockTransportAdapterImpl transport_adapter(NULL, NULL, NULL, last_state_, transport_manager_settings); + MockTransportAdapterImpl transport_adapter( + NULL, NULL, NULL, last_state_, transport_manager_settings); EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true)); transport_adapter.Init(); @@ -171,12 +180,11 @@ TEST_F(TransportAdapterTest, SearchDeviceFailed) { } TEST_F(TransportAdapterTest, AddDevice) { - MockTransportAdapterImpl transport_adapter(NULL, NULL, NULL, last_state_, transport_manager_settings); + MockTransportAdapterImpl transport_adapter( + NULL, NULL, NULL, last_state_, transport_manager_settings); EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true)); transport_adapter.Init(); - - MockTransportAdapterListener mock_listener; transport_adapter.AddListener(&mock_listener); @@ -188,7 +196,8 @@ TEST_F(TransportAdapterTest, AddDevice) { TEST_F(TransportAdapterTest, Connect_ServerNotSupported) { MockClientConnectionListener* clientMock = new MockClientConnectionListener(); - MockTransportAdapterImpl transport_adapter(NULL, NULL, clientMock, last_state_, transport_manager_settings); + MockTransportAdapterImpl transport_adapter( + NULL, NULL, clientMock, last_state_, transport_manager_settings); EXPECT_CALL(*clientMock, Init()).WillOnce(Return(TransportAdapter::OK)); EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true)); @@ -204,14 +213,13 @@ TEST_F(TransportAdapterTest, Connect_ServerNotSupported) { TEST_F(TransportAdapterTest, Connect_ServerNotInitialized) { MockServerConnectionFactory* serverMock = new MockServerConnectionFactory(); - MockTransportAdapterImpl transport_adapter(NULL, serverMock, NULL, last_state_, transport_manager_settings); + MockTransportAdapterImpl transport_adapter( + NULL, serverMock, NULL, last_state_, transport_manager_settings); EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK)); EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true)); transport_adapter.Init(); - - EXPECT_CALL(*serverMock, IsInitialised()).WillOnce(Return(false)); EXPECT_CALL(*serverMock, CreateConnection(dev_id, app_handle)).Times(0); TransportAdapter::Error res = transport_adapter.Connect(dev_id, app_handle); @@ -222,14 +230,13 @@ TEST_F(TransportAdapterTest, Connect_ServerNotInitialized) { TEST_F(TransportAdapterTest, Connect_Success) { MockServerConnectionFactory* serverMock = new MockServerConnectionFactory(); - MockTransportAdapterImpl transport_adapter(NULL, serverMock, NULL, last_state_, transport_manager_settings); + MockTransportAdapterImpl transport_adapter( + NULL, serverMock, NULL, last_state_, transport_manager_settings); EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK)); EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true)); transport_adapter.Init(); - - EXPECT_CALL(*serverMock, IsInitialised()).WillOnce(Return(true)); EXPECT_CALL(*serverMock, CreateConnection(dev_id, app_handle)) .WillOnce(Return(TransportAdapter::OK)); @@ -241,14 +248,13 @@ TEST_F(TransportAdapterTest, Connect_Success) { TEST_F(TransportAdapterTest, Connect_DeviceAddedTwice) { MockServerConnectionFactory* serverMock = new MockServerConnectionFactory(); - MockTransportAdapterImpl transport_adapter(NULL, serverMock, NULL, last_state_, transport_manager_settings); + MockTransportAdapterImpl transport_adapter( + NULL, serverMock, NULL, last_state_, transport_manager_settings); EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK)); EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true)); transport_adapter.Init(); - - EXPECT_CALL(*serverMock, IsInitialised()).WillOnce(Return(true)); EXPECT_CALL(*serverMock, CreateConnection(dev_id, app_handle)) .WillOnce(Return(TransportAdapter::OK)); @@ -264,12 +270,11 @@ TEST_F(TransportAdapterTest, Connect_DeviceAddedTwice) { } TEST_F(TransportAdapterTest, ConnectDevice_ServerNotAdded_DeviceAdded) { - MockTransportAdapterImpl transport_adapter(NULL, NULL, NULL, last_state_, transport_manager_settings); + MockTransportAdapterImpl transport_adapter( + NULL, NULL, NULL, last_state_, transport_manager_settings); EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true)); transport_adapter.Init(); - - MockDevice* mockdev = new MockDevice(dev_id, uniq_id); transport_adapter.AddDevice(mockdev); @@ -287,7 +292,8 @@ TEST_F(TransportAdapterTest, ConnectDevice_ServerNotAdded_DeviceAdded) { TEST_F(TransportAdapterTest, ConnectDevice_DeviceNotAdded) { MockServerConnectionFactory* serverMock = new MockServerConnectionFactory(); - MockTransportAdapterImpl transport_adapter(NULL, serverMock, NULL, last_state_, transport_manager_settings); + MockTransportAdapterImpl transport_adapter( + NULL, serverMock, NULL, last_state_, transport_manager_settings); EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK)); EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true)); transport_adapter.Init(); @@ -304,14 +310,13 @@ TEST_F(TransportAdapterTest, ConnectDevice_DeviceNotAdded) { TEST_F(TransportAdapterTest, ConnectDevice_DeviceAdded) { MockServerConnectionFactory* serverMock = new MockServerConnectionFactory(); - MockTransportAdapterImpl transport_adapter(NULL, serverMock, NULL, last_state_, transport_manager_settings); + MockTransportAdapterImpl transport_adapter( + NULL, serverMock, NULL, last_state_, transport_manager_settings); EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK)); EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true)); transport_adapter.Init(); - - MockDevice* mockdev = new MockDevice(dev_id, uniq_id); transport_adapter.AddDevice(mockdev); @@ -319,7 +324,6 @@ TEST_F(TransportAdapterTest, ConnectDevice_DeviceAdded) { ASSERT_EQ(1u, devList.size()); EXPECT_EQ(uniq_id, devList[0]); - int app_handle = 1; std::vector<int> intList = {app_handle}; EXPECT_CALL(*mockdev, GetApplicationList()).WillOnce(Return(intList)); @@ -335,14 +339,13 @@ TEST_F(TransportAdapterTest, ConnectDevice_DeviceAdded) { TEST_F(TransportAdapterTest, ConnectDevice_DeviceAddedTwice) { MockServerConnectionFactory* serverMock = new MockServerConnectionFactory(); - MockTransportAdapterImpl transport_adapter(NULL, serverMock, NULL, last_state_, transport_manager_settings); + MockTransportAdapterImpl transport_adapter( + NULL, serverMock, NULL, last_state_, transport_manager_settings); EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK)); EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true)); transport_adapter.Init(); - - MockDevice* mockdev = new MockDevice(dev_id, uniq_id); transport_adapter.AddDevice(mockdev); @@ -350,7 +353,6 @@ TEST_F(TransportAdapterTest, ConnectDevice_DeviceAddedTwice) { ASSERT_EQ(1u, devList.size()); EXPECT_EQ(uniq_id, devList[0]); - int app_handle = 1; std::vector<int> intList = {app_handle}; EXPECT_CALL(*mockdev, GetApplicationList()).WillOnce(Return(intList)); @@ -375,14 +377,13 @@ TEST_F(TransportAdapterTest, ConnectDevice_DeviceAddedTwice) { TEST_F(TransportAdapterTest, Disconnect_ConnectDoneSuccess) { MockServerConnectionFactory* serverMock = new MockServerConnectionFactory(); - MockTransportAdapterImpl transport_adapter(NULL, serverMock, NULL, last_state_, transport_manager_settings); + MockTransportAdapterImpl transport_adapter( + NULL, serverMock, NULL, last_state_, transport_manager_settings); EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK)); EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true)); transport_adapter.Init(); - - EXPECT_CALL(*serverMock, IsInitialised()).WillOnce(Return(true)); EXPECT_CALL(*serverMock, CreateConnection(dev_id, app_handle)) .WillOnce(Return(TransportAdapter::OK)); @@ -406,7 +407,8 @@ TEST_F(TransportAdapterTest, Disconnect_ConnectDoneSuccess) { TEST_F(TransportAdapterTest, DisconnectDevice_DeviceAddedConnectionCreated) { MockServerConnectionFactory* serverMock = new MockServerConnectionFactory(); - MockTransportAdapterImpl transport_adapter(NULL, serverMock,NULL, last_state_, transport_manager_settings); + MockTransportAdapterImpl transport_adapter( + NULL, serverMock, NULL, last_state_, transport_manager_settings); EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK)); EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true)); @@ -419,7 +421,6 @@ TEST_F(TransportAdapterTest, DisconnectDevice_DeviceAddedConnectionCreated) { ASSERT_EQ(1u, devList.size()); EXPECT_EQ(uniq_id, devList[0]); - std::vector<int> intList = {app_handle}; EXPECT_CALL(*mockdev, GetApplicationList()).WillOnce(Return(intList)); @@ -443,7 +444,8 @@ TEST_F(TransportAdapterTest, DisconnectDevice_DeviceAddedConnectionCreated) { TEST_F(TransportAdapterTest, DeviceDisconnected) { MockServerConnectionFactory* serverMock = new MockServerConnectionFactory(); - MockTransportAdapterImpl transport_adapter(NULL, serverMock,NULL, last_state_, transport_manager_settings); + MockTransportAdapterImpl transport_adapter( + NULL, serverMock, NULL, last_state_, transport_manager_settings); EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK)); EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true)); @@ -473,8 +475,9 @@ TEST_F(TransportAdapterTest, DeviceDisconnected) { transport_adapter.ConnectionCreated(mock_connection, uniq_id, app_handle); EXPECT_CALL(*mockdev, GetApplicationList()).WillOnce(Return(intList)); - EXPECT_CALL(mock_listener, OnUnexpectedDisconnect(&transport_adapter, uniq_id, - app_handle, _)); + EXPECT_CALL( + mock_listener, + OnUnexpectedDisconnect(&transport_adapter, uniq_id, app_handle, _)); EXPECT_CALL(mock_listener, OnDisconnectDeviceDone(&transport_adapter, uniq_id)); EXPECT_CALL(mock_listener, OnDeviceListUpdated(&transport_adapter)); @@ -486,7 +489,8 @@ TEST_F(TransportAdapterTest, DeviceDisconnected) { TEST_F(TransportAdapterTest, AbortedConnectSuccess) { MockServerConnectionFactory* serverMock = new MockServerConnectionFactory(); - MockTransportAdapterImpl transport_adapter(NULL, serverMock,NULL, last_state_, transport_manager_settings); + MockTransportAdapterImpl transport_adapter( + NULL, serverMock, NULL, last_state_, transport_manager_settings); EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK)); EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true)); @@ -511,7 +515,8 @@ TEST_F(TransportAdapterTest, AbortedConnectSuccess) { TEST_F(TransportAdapterTest, SendData) { MockDeviceScanner* dev_mock = new MockDeviceScanner(); MockServerConnectionFactory* serverMock = new MockServerConnectionFactory(); - MockTransportAdapterImpl transport_adapter(dev_mock, serverMock,NULL, last_state_, transport_manager_settings); + MockTransportAdapterImpl transport_adapter( + dev_mock, serverMock, NULL, last_state_, transport_manager_settings); EXPECT_CALL(*dev_mock, Init()).WillOnce(Return(TransportAdapter::OK)); EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK)); @@ -547,7 +552,11 @@ TEST_F(TransportAdapterTest, SendData_ConnectionNotEstablished) { MockDeviceScanner* dev_mock = new MockDeviceScanner(); MockClientConnectionListener* clientMock = new MockClientConnectionListener(); MockServerConnectionFactory* serverMock = new MockServerConnectionFactory(); - MockTransportAdapterImpl transport_adapter(dev_mock, serverMock, clientMock, last_state_, transport_manager_settings); + MockTransportAdapterImpl transport_adapter(dev_mock, + serverMock, + clientMock, + last_state_, + transport_manager_settings); EXPECT_CALL(*dev_mock, Init()).WillOnce(Return(TransportAdapter::OK)); EXPECT_CALL(*clientMock, Init()).WillOnce(Return(TransportAdapter::OK)); @@ -580,7 +589,8 @@ TEST_F(TransportAdapterTest, SendData_ConnectionNotEstablished) { TEST_F(TransportAdapterTest, StartClientListening_ClientNotInitialized) { MockDeviceScanner* dev_mock = new MockDeviceScanner(); MockClientConnectionListener* clientMock = new MockClientConnectionListener(); - MockTransportAdapterImpl transport_adapter(dev_mock, NULL, clientMock, last_state_, transport_manager_settings); + MockTransportAdapterImpl transport_adapter( + dev_mock, NULL, clientMock, last_state_, transport_manager_settings); EXPECT_CALL(*dev_mock, Init()).WillOnce(Return(TransportAdapter::OK)); EXPECT_CALL(*clientMock, Init()).WillOnce(Return(TransportAdapter::OK)); @@ -600,7 +610,8 @@ TEST_F(TransportAdapterTest, StartClientListening_ClientNotInitialized) { TEST_F(TransportAdapterTest, StartClientListening) { MockDeviceScanner* dev_mock = new MockDeviceScanner(); MockClientConnectionListener* clientMock = new MockClientConnectionListener(); - MockTransportAdapterImpl transport_adapter(dev_mock, NULL, clientMock, last_state_, transport_manager_settings); + MockTransportAdapterImpl transport_adapter( + dev_mock, NULL, clientMock, last_state_, transport_manager_settings); EXPECT_CALL(*dev_mock, Init()).WillOnce(Return(TransportAdapter::OK)); EXPECT_CALL(*clientMock, Init()).WillOnce(Return(TransportAdapter::OK)); @@ -622,7 +633,11 @@ TEST_F(TransportAdapterTest, StopClientListening_Success) { MockDeviceScanner* dev_mock = new MockDeviceScanner(); MockClientConnectionListener* clientMock = new MockClientConnectionListener(); MockServerConnectionFactory* serverMock = new MockServerConnectionFactory(); - MockTransportAdapterImpl transport_adapter(dev_mock, serverMock, clientMock, last_state_, transport_manager_settings); + MockTransportAdapterImpl transport_adapter(dev_mock, + serverMock, + clientMock, + last_state_, + transport_manager_settings); EXPECT_CALL(*dev_mock, Init()).WillOnce(Return(TransportAdapter::OK)); EXPECT_CALL(*clientMock, Init()).WillOnce(Return(TransportAdapter::OK)); @@ -652,7 +667,11 @@ TEST_F(TransportAdapterTest, FindNewApplicationsRequest) { MockDeviceScanner* dev_mock = new MockDeviceScanner(); MockClientConnectionListener* clientMock = new MockClientConnectionListener(); MockServerConnectionFactory* serverMock = new MockServerConnectionFactory(); - MockTransportAdapterImpl transport_adapter(dev_mock, serverMock, clientMock, last_state_, transport_manager_settings); + MockTransportAdapterImpl transport_adapter(dev_mock, + serverMock, + clientMock, + last_state_, + transport_manager_settings); EXPECT_CALL(*dev_mock, Init()).WillOnce(Return(TransportAdapter::OK)); EXPECT_CALL(*clientMock, Init()).WillOnce(Return(TransportAdapter::OK)); @@ -672,7 +691,8 @@ TEST_F(TransportAdapterTest, FindNewApplicationsRequest) { } TEST_F(TransportAdapterTest, GetDeviceAndApplicationLists) { - MockTransportAdapterImpl transport_adapter(NULL, NULL,NULL, last_state_, transport_manager_settings); + MockTransportAdapterImpl transport_adapter( + NULL, NULL, NULL, last_state_, transport_manager_settings); EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true)); transport_adapter.Init(); @@ -689,12 +709,12 @@ TEST_F(TransportAdapterTest, GetDeviceAndApplicationLists) { std::vector<int> res = transport_adapter.GetApplicationList(uniq_id); ASSERT_EQ(1u, res.size()); EXPECT_EQ(intList[0], res[0]); - } TEST_F(TransportAdapterTest, FindEstablishedConnection) { MockServerConnectionFactory* serverMock = new MockServerConnectionFactory(); - MockTransportAdapterImpl transport_adapter(NULL, serverMock,NULL, last_state_, transport_manager_settings); + MockTransportAdapterImpl transport_adapter( + NULL, serverMock, NULL, last_state_, transport_manager_settings); EXPECT_CALL(*serverMock, Init()).WillOnce(Return(TransportAdapter::OK)); EXPECT_CALL(transport_adapter, Restore()).WillOnce(Return(true)); diff --git a/src/components/transport_manager/test/transport_manager_default_test.cc b/src/components/transport_manager/test/transport_manager_default_test.cc index 4531b662a7..672e48e8ce 100644 --- a/src/components/transport_manager/test/transport_manager_default_test.cc +++ b/src/components/transport_manager/test/transport_manager_default_test.cc @@ -43,22 +43,28 @@ namespace transport_manager_test { using ::testing::Return; TEST(TestTransportManagerDefault, Init_LastStateNotUsed) { MockTransportManagerSettings transport_manager_settings; - transport_manager::TransportManagerDefault transport_manager(transport_manager_settings); + transport_manager::TransportManagerDefault transport_manager( + transport_manager_settings); resumption::LastState last_state("app_storage_folder", "app_info_storage"); - EXPECT_CALL(transport_manager_settings,use_last_state()).WillRepeatedly(Return(false)); - EXPECT_CALL(transport_manager_settings, transport_manager_tcp_adapter_port()).WillRepeatedly(Return(1u)); + EXPECT_CALL(transport_manager_settings, use_last_state()) + .WillRepeatedly(Return(false)); + EXPECT_CALL(transport_manager_settings, transport_manager_tcp_adapter_port()) + .WillRepeatedly(Return(1u)); transport_manager.Init(last_state); } -//TODO(VVeremjova) APPLINK-22021 +// TODO(VVeremjova) APPLINK-22021 TEST(TestTransportManagerDefault, DISABLED_Init_LastStateUsed) { MockTransportManagerSettings transport_manager_settings; - transport_manager::TransportManagerDefault transport_manager(transport_manager_settings); + transport_manager::TransportManagerDefault transport_manager( + transport_manager_settings); resumption::LastState last_state("app_storage_folder", "app_info_storage"); - EXPECT_CALL(transport_manager_settings, use_last_state()).WillRepeatedly(Return(true)); - EXPECT_CALL(transport_manager_settings, transport_manager_tcp_adapter_port()).WillRepeatedly(Return(1u)); + EXPECT_CALL(transport_manager_settings, use_last_state()) + .WillRepeatedly(Return(true)); + EXPECT_CALL(transport_manager_settings, transport_manager_tcp_adapter_port()) + .WillRepeatedly(Return(1u)); transport_manager.Init(last_state); } diff --git a/src/components/transport_manager/test/transport_manager_impl_test.cc b/src/components/transport_manager/test/transport_manager_impl_test.cc index fa3b69e1b9..0e6cd5c78e 100644 --- a/src/components/transport_manager/test/transport_manager_impl_test.cc +++ b/src/components/transport_manager/test/transport_manager_impl_test.cc @@ -70,13 +70,12 @@ class TransportManagerImplTest : public ::testing::Test { protected: TransportManagerImplTest() : tm_(settings) - , device_handle_(1) + , device_handle_(1) , mac_address_("MA:CA:DR:ES:S") , dev_info_(device_handle_, mac_address_, "TestDeviceName", "BTMAC") {} void SetUp() OVERRIDE { - resumption::LastState last_state_("app_storage_folder", - "app_info_storage"); + resumption::LastState last_state_("app_storage_folder", "app_info_storage"); tm_.Init(last_state_); mock_adapter_ = new MockTransportAdapter(); tm_listener_ = MakeShared<TransportManagerListenerMock>(); @@ -332,8 +331,9 @@ class TransportManagerImplTest : public ::testing::Test { }; TEST_F(TransportManagerImplTest, SearchDevices_AdaptersNotAdded) { - EXPECT_CALL(*mock_adapter_, SearchDevices()).WillOnce(Return( - transport_manager::transport_adapter::TransportAdapter::OK)); + EXPECT_CALL(*mock_adapter_, SearchDevices()) + .WillOnce( + Return(transport_manager::transport_adapter::TransportAdapter::OK)); EXPECT_EQ(E_SUCCESS, tm_.SearchDevices()); } @@ -408,11 +408,12 @@ TEST_F(TransportManagerImplTest, Disconnect_DisconnectionFailed) { .WillOnce(Return(TransportAdapter::FAIL)); // Assert // Even with fail, we get Success - EXPECT_EQ(E_SUCCESS, tm_.Disconnect(connection_key_)); + EXPECT_EQ(E_SUCCESS, tm_.Disconnect(connection_key_)); } TEST_F(TransportManagerImplTest, Disconnect_ConnectionNotExist) { - EXPECT_CALL(*mock_adapter_, Disconnect(mac_address_, application_id_)).Times(0); + EXPECT_CALL(*mock_adapter_, Disconnect(mac_address_, application_id_)) + .Times(0); // Assert EXPECT_EQ(E_INVALID_HANDLE, tm_.Disconnect(connection_key_)); } @@ -494,7 +495,7 @@ TEST_F(TransportManagerImplTest, SendMessageToDevice) { .WillOnce(Return(TransportAdapter::OK)); #ifdef TELEMETRY_MONITOR - EXPECT_CALL(mock_metric_observer_, StartRawMsg(test_message_.get())); + EXPECT_CALL(mock_metric_observer_, StartRawMsg(test_message_.get())); #endif // TELEMETRY_MONITOR EXPECT_EQ(E_SUCCESS, tm_.SendMessageToDevice(test_message_)); @@ -673,8 +674,12 @@ TEST_F(TransportManagerImplTest, ReceiveEventFromDevice_OnSearchDeviceFail) { const int type = static_cast<int>( TransportAdapterListenerImpl::EventTypeEnum::ON_SEARCH_FAIL); - TransportAdapterEvent test_event(type, mock_adapter_, mac_address_, - application_id_, test_message_, error_); + TransportAdapterEvent test_event(type, + mock_adapter_, + mac_address_, + application_id_, + test_message_, + error_); EXPECT_CALL(*tm_listener_, OnScanDevicesFailed(_)); @@ -686,8 +691,12 @@ TEST_F(TransportManagerImplTest, ReceiveEventFromDevice_DeviceListUpdated) { const int type = static_cast<int>( TransportAdapterListenerImpl::EventTypeEnum::ON_DEVICE_LIST_UPDATED); - TransportAdapterEvent test_event(type, mock_adapter_, dev_info_.mac_address(), - application_id_, test_message_, error_); + TransportAdapterEvent test_event(type, + mock_adapter_, + dev_info_.mac_address(), + application_id_, + test_message_, + error_); device_list_.push_back(dev_info_.mac_address()); std::vector<DeviceInfo> vector_dev_info; vector_dev_info.push_back(dev_info_); diff --git a/src/components/utils/src/threads/posix_thread.cc b/src/components/utils/src/threads/posix_thread.cc index b1ee2f87a1..e44b286b33 100644 --- a/src/components/utils/src/threads/posix_thread.cc +++ b/src/components/utils/src/threads/posix_thread.cc @@ -55,7 +55,8 @@ namespace threads { CREATE_LOGGERPTR_GLOBAL(logger_, "Utils") -size_t Thread::kMinStackSize = PTHREAD_STACK_MIN; /* Ubuntu : 16384 ; QNX : 256; */ +size_t Thread::kMinStackSize = + PTHREAD_STACK_MIN; /* Ubuntu : 16384 ; QNX : 256; */ void Thread::cleanup(void* arg) { LOG4CXX_AUTO_TRACE(logger_); @@ -85,35 +86,35 @@ void* Thread::threadFunc(void* arg) { pthread_cleanup_push(&cleanup, thread); - thread->state_lock_.Acquire(); - thread->state_cond_.Broadcast(); + thread->state_lock_.Acquire(); + thread->state_cond_.Broadcast(); - while (!thread->finalized_) { - LOG4CXX_DEBUG(logger_, "Thread #" << pthread_self() << " iteration"); - thread->run_cond_.Wait(thread->state_lock_); - LOG4CXX_DEBUG( - logger_, - "Thread #" << pthread_self() << " execute. " << "stopped_ = " - << thread->stopped_ << "; finalized_ = " << thread->finalized_); - if (!thread->stopped_ && !thread->finalized_) { - thread->isThreadRunning_ = true; - pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); - pthread_testcancel(); - - thread->state_lock_.Release(); - thread->delegate_->threadMain(); - thread->state_lock_.Acquire(); - - pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); - thread->isThreadRunning_ = false; - } - thread->state_cond_.Broadcast(); - LOG4CXX_DEBUG(logger_, - "Thread #" << pthread_self() << " finished iteration"); + while (!thread->finalized_) { + LOG4CXX_DEBUG(logger_, "Thread #" << pthread_self() << " iteration"); + thread->run_cond_.Wait(thread->state_lock_); + LOG4CXX_DEBUG(logger_, + "Thread #" << pthread_self() << " execute. " + << "stopped_ = " << thread->stopped_ + << "; finalized_ = " << thread->finalized_); + if (!thread->stopped_ && !thread->finalized_) { + thread->isThreadRunning_ = true; + pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); + pthread_testcancel(); + + thread->state_lock_.Release(); + thread->delegate_->threadMain(); + thread->state_lock_.Acquire(); + + pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL); + thread->isThreadRunning_ = false; } + thread->state_cond_.Broadcast(); + LOG4CXX_DEBUG(logger_, + "Thread #" << pthread_self() << " finished iteration"); + } - thread->state_lock_.Release(); - pthread_cleanup_pop(1); + thread->state_lock_.Release(); + pthread_cleanup_pop(1); LOG4CXX_DEBUG(logger_, "Thread #" << pthread_self() << " exited successfully"); @@ -126,23 +127,22 @@ void Thread::SetNameForId(const PlatformThreadHandle& thread_id, name.erase(THREAD_NAME_SIZE); const int rc = pthread_setname_np(thread_id, name.c_str()); if (rc != EOK) { - LOG4CXX_WARN( - logger_, - "Couldn't set pthread name \"" << name << "\", error code " - << rc << " (" << strerror(rc) << ")"); + LOG4CXX_WARN(logger_, + "Couldn't set pthread name \"" << name << "\", error code " + << rc << " (" << strerror(rc) + << ")"); } } Thread::Thread(const char* name, ThreadDelegate* delegate) - : name_(name ? name : "undefined"), - delegate_(delegate), - handle_(0), - thread_options_(), - isThreadRunning_(0), - stopped_(false), - finalized_(false), - thread_created_(false) { -} + : name_(name ? name : "undefined") + , delegate_(delegate) + , handle_(0) + , thread_options_() + , isThreadRunning_(0) + , stopped_(false) + , finalized_(false) + , thread_created_(false) {} bool Thread::start() { return start(thread_options_); @@ -172,9 +172,9 @@ bool Thread::start(const ThreadOptions& options) { } if (isThreadRunning_) { - LOG4CXX_TRACE( - logger_, - "EXIT thread "<< name_ << " #" << handle_ << " is already running"); + LOG4CXX_TRACE(logger_, + "EXIT thread " << name_ << " #" << handle_ + << " is already running"); return true; } @@ -183,19 +183,20 @@ bool Thread::start(const ThreadOptions& options) { pthread_attr_t attributes; int pthread_result = pthread_attr_init(&attributes); if (pthread_result != EOK) { - LOG4CXX_WARN( - logger_, - "Couldn't init pthread attributes. Error code = "<< pthread_result - << " (\"" << strerror(pthread_result) << "\")"); + LOG4CXX_WARN(logger_, + "Couldn't init pthread attributes. Error code = " + << pthread_result << " (\"" << strerror(pthread_result) + << "\")"); } if (!thread_options_.is_joinable()) { - pthread_result = pthread_attr_setdetachstate(&attributes, PTHREAD_CREATE_DETACHED); + pthread_result = + pthread_attr_setdetachstate(&attributes, PTHREAD_CREATE_DETACHED); if (pthread_result != EOK) { - LOG4CXX_WARN( - logger_, - "Couldn't set detach state attribute. Error code = " << pthread_result - << " (\"" << strerror(pthread_result) << "\")"); + LOG4CXX_WARN(logger_, + "Couldn't set detach state attribute. Error code = " + << pthread_result << " (\"" << strerror(pthread_result) + << "\")"); thread_options_.is_joinable(false); } } @@ -204,13 +205,14 @@ bool Thread::start(const ThreadOptions& options) { if (stack_size >= Thread::kMinStackSize) { pthread_result = pthread_attr_setstacksize(&attributes, stack_size); if (pthread_result != EOK) { - LOG4CXX_WARN( - logger_, - "Couldn't set stacksize = " << stack_size << ". Error code = " - << pthread_result << " (\"" << strerror(pthread_result) << "\")"); + LOG4CXX_WARN(logger_, + "Couldn't set stacksize = " + << stack_size << ". Error code = " << pthread_result + << " (\"" << strerror(pthread_result) << "\")"); } } else { - ThreadOptions thread_options_temp(Thread::kMinStackSize, thread_options_.is_joinable()); + ThreadOptions thread_options_temp(Thread::kMinStackSize, + thread_options_.is_joinable()); thread_options_ = thread_options_temp; } @@ -225,17 +227,17 @@ bool Thread::start(const ThreadOptions& options) { state_cond_.Wait(auto_lock); thread_created_ = true; } else { - LOG4CXX_ERROR( - logger_, - "Couldn't create thread " << name_ << ". Error code = " - << pthread_result <<" (\"" << strerror(pthread_result) << "\")"); + LOG4CXX_ERROR(logger_, + "Couldn't create thread " + << name_ << ". Error code = " << pthread_result + << " (\"" << strerror(pthread_result) << "\")"); } } stopped_ = false; run_cond_.NotifyOne(); LOG4CXX_DEBUG(logger_, - "Thread " << name_ << " #" << handle_<< " started." << - " pthread_result = " << pthread_result); + "Thread " << name_ << " #" << handle_ << " started." + << " pthread_result = " << pthread_result); pthread_attr_destroy(&attributes); return pthread_result == EOK; } @@ -250,8 +252,8 @@ void Thread::stop() { stopped_ = true; - LOG4CXX_DEBUG(logger_, "Stopping thread #" << handle_ - << " \"" << name_ << "\""); + LOG4CXX_DEBUG(logger_, + "Stopping thread #" << handle_ << " \"" << name_ << "\""); if (delegate_ && isThreadRunning_) { delegate_->exitThreadMain(); @@ -271,8 +273,10 @@ void Thread::join() { run_cond_.NotifyOne(); if (isThreadRunning_) { if (!pthread_equal(pthread_self(), handle_)) { - LOG4CXX_DEBUG(logger_, "Waiting for #"<< handle_ - << " finished iteration in thread #" << pthread_self()); + LOG4CXX_DEBUG(logger_, + "Waiting for #" << handle_ + << " finished iteration in thread #" + << pthread_self()); state_cond_.Wait(auto_lock); } } diff --git a/src/components/utils/test/auto_trace_test.cc b/src/components/utils/test/auto_trace_test.cc index f3aaea490f..055aba4a53 100644 --- a/src/components/utils/test/auto_trace_test.cc +++ b/src/components/utils/test/auto_trace_test.cc @@ -62,15 +62,16 @@ void Preconditions() { void InitLogger() { // Set enabled logs - INIT_LOGGER("log4cxx.properties", true); // DEINIT_LOGGER will be called in test_main.cc + INIT_LOGGER("log4cxx.properties", + true); // DEINIT_LOGGER will be called in test_main.cc } -void CreateDeleteAutoTrace(const std::string & testlog) { +void CreateDeleteAutoTrace(const std::string& testlog) { LOG4CXX_AUTO_TRACE(logger_); LOG4CXX_DEBUG(logger_, testlog); } -bool CheckAutoTraceDebugInFile(const std::string & testlog) { +bool CheckAutoTraceDebugInFile(const std::string& testlog) { bool isLogFound = false; std::string line; @@ -93,8 +94,7 @@ bool CheckAutoTraceDebugInFile(const std::string & testlog) { } TEST(AutoTraceTest, AutoTrace_WriteToFile_ReadCorrectString) { - const std::string testlog = - "Test trace is working!"; + const std::string testlog = "Test trace is working!"; Preconditions(); InitLogger(); CreateDeleteAutoTrace(testlog); @@ -105,7 +105,8 @@ TEST(AutoTraceTest, AutoTrace_WriteToFile_ReadCorrectString) { LogMessageLoopThread loop_thread; while (loop_thread.GetMessageQueueSize()) { ASSERT_LT(date_time::DateTime::calculateTimeDiff( - date_time::DateTime::getCurrentTime(), startTime), timeout_msec); + date_time::DateTime::getCurrentTime(), startTime), + timeout_msec); threads::Thread::yield(); } ASSERT_TRUE(CheckAutoTraceDebugInFile(testlog)); |