diff options
Diffstat (limited to 'src/components/application_manager/rpc_plugins/sdl_rpc_plugin')
30 files changed, 92 insertions, 421 deletions
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_reset_timeout_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_reset_timeout_notification.h index 1c87f82349..57c6f55e03 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_ui_reset_timeout_notification.h +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_reset_timeout_notification.h @@ -30,8 +30,8 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_RESET_TIMEOUT_NOTIFICATION_H_ -#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_RESET_TIMEOUT_NOTIFICATION_H_ +#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_RESET_TIMEOUT_NOTIFICATION_H_ +#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_RESET_TIMEOUT_NOTIFICATION_H_ #include "application_manager/commands/notification_from_hmi.h" @@ -43,17 +43,17 @@ namespace commands { namespace hmi { /** - * @brief OnUIResetTimeoutNotification command class + * @brief OnResetTimeoutNotification command class **/ -class OnUIResetTimeoutNotification +class OnResetTimeoutNotification : public app_mngr::commands::NotificationFromHMI { public: /** - * @brief OnUIResetTimeoutNotification class constructor + * @brief OnResetTimeoutNotification class constructor * * @param message Incoming SmartObject message **/ - OnUIResetTimeoutNotification( + OnResetTimeoutNotification( const app_mngr::commands::MessageSharedPtr& message, app_mngr::ApplicationManager& application_manager, app_mngr::rpc_service::RPCService& rpc_service, @@ -61,9 +61,9 @@ class OnUIResetTimeoutNotification policy::PolicyHandlerInterface& policy_handle); /** - * @brief OnUIResetTimeoutNotification class destructor + * @brief OnResetTimeoutNotification class destructor **/ - virtual ~OnUIResetTimeoutNotification(); + virtual ~OnResetTimeoutNotification(); /** * @brief Execute command @@ -71,7 +71,7 @@ class OnUIResetTimeoutNotification virtual void Run(); private: - DISALLOW_COPY_AND_ASSIGN(OnUIResetTimeoutNotification); + DISALLOW_COPY_AND_ASSIGN(OnResetTimeoutNotification); }; } // namespace hmi @@ -80,4 +80,4 @@ class OnUIResetTimeoutNotification } // namespace sdl_rpc_plugin -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_UI_RESET_TIMEOUT_NOTIFICATION_H_ +#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_RESET_TIMEOUT_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_reset_timeout_notification.h b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_reset_timeout_notification.h deleted file mode 100644 index c8bd159064..0000000000 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/include/sdl_rpc_plugin/commands/hmi/on_tts_reset_timeout_notification.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2018, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_TTS_RESET_TIMEOUT_NOTIFICATION_H_ -#define SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_TTS_RESET_TIMEOUT_NOTIFICATION_H_ - -#include "application_manager/commands/notification_from_hmi.h" - -namespace sdl_rpc_plugin { -namespace app_mngr = application_manager; - -namespace commands { - -namespace hmi { - -/** - * @brief OnTTSResetTimeoutNotification command class - **/ -class OnTTSResetTimeoutNotification - : public app_mngr::commands::NotificationFromHMI { - public: - /** - * @brief OnTTSResetTimeoutNotification class constructor - * - * @param message Incoming SmartObject message - **/ - OnTTSResetTimeoutNotification( - const app_mngr::commands::MessageSharedPtr& message, - app_mngr::ApplicationManager& application_manager, - app_mngr::rpc_service::RPCService& rpc_service, - app_mngr::HMICapabilities& hmi_capabilities, - policy::PolicyHandlerInterface& policy_handle); - - /** - * @brief OnTTSResetTimeoutNotification class destructor - **/ - virtual ~OnTTSResetTimeoutNotification(); - - /** - * @brief Execute command - **/ - virtual void Run(); - - private: - DISALLOW_COPY_AND_ASSIGN(OnTTSResetTimeoutNotification); -}; - -} // namespace hmi - -} // namespace commands - -} // namespace sdl_rpc_plugin - -#endif // SRC_COMPONENTS_APPLICATION_MANAGER_RPC_PLUGINS_SDL_RPC_PLUGIN_INCLUDE_SDL_RPC_PLUGIN_COMMANDS_HMI_ON_TTS_RESET_TIMEOUT_NOTIFICATION_H_ diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_request.cc index 21d6282436..05d0a4e8f2 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_audio_start_stream_request.cc @@ -58,9 +58,11 @@ AudioStartStreamRequest::AudioStartStreamRequest( SDL_LOG_AUTO_TRACE(); std::pair<uint32_t, int32_t> stream_retry = application_manager_.get_settings().start_stream_retry_amount(); - default_timeout_ = stream_retry.second; + default_timeout_ = + stream_retry.second + + application_manager_.get_settings().default_timeout_compensation(); retry_number_ = stream_retry.first; - SDL_LOG_DEBUG("default_timeout_ = " << default_timeout_ + SDL_LOG_DEBUG("default_timeout_ = " << stream_retry.second << "; retry_number_ = " << retry_number_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_request.cc index 973c323ebe..c671b11282 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/navi_start_stream_request.cc @@ -58,9 +58,11 @@ NaviStartStreamRequest::NaviStartStreamRequest( SDL_LOG_AUTO_TRACE(); std::pair<uint32_t, int32_t> stream_retry = application_manager_.get_settings().start_stream_retry_amount(); - default_timeout_ = stream_retry.second; + default_timeout_ = + stream_retry.second + + application_manager_.get_settings().default_timeout_compensation(); retry_number_ = stream_retry.first; - SDL_LOG_DEBUG("default_timeout_ = " << default_timeout_ + SDL_LOG_DEBUG("default_timeout_ = " << stream_retry.second << "; retry_number_ = " << retry_number_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_reset_timeout_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_reset_timeout_notification.cc index 96f6c5cd5b..ff5b2709c0 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_tts_reset_timeout_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_reset_timeout_notification.cc @@ -29,7 +29,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ -#include "sdl_rpc_plugin/commands/hmi/on_tts_reset_timeout_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_reset_timeout_notification.h" #include "application_manager/event_engine/event.h" #include "interfaces/HMI_API.h" @@ -42,7 +42,7 @@ namespace hmi { SDL_CREATE_LOG_VARIABLE("Commands") -OnTTSResetTimeoutNotification::OnTTSResetTimeoutNotification( +OnResetTimeoutNotification::OnResetTimeoutNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, rpc_service::RPCService& rpc_service, @@ -54,12 +54,13 @@ OnTTSResetTimeoutNotification::OnTTSResetTimeoutNotification( hmi_capabilities, policy_handle) {} -OnTTSResetTimeoutNotification::~OnTTSResetTimeoutNotification() {} +OnResetTimeoutNotification::~OnResetTimeoutNotification() {} -void OnTTSResetTimeoutNotification::Run() { +void OnResetTimeoutNotification::Run() { SDL_LOG_AUTO_TRACE(); - event_engine::Event event(hmi_apis::FunctionID::TTS_OnResetTimeout); + event_engine::Event event( + hmi_apis::FunctionID::BasicCommunication_OnResetTimeout); event.set_smart_object(*message_); event.raise(application_manager_.event_dispatcher()); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_reset_timeout_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_reset_timeout_notification.cc deleted file mode 100644 index d8de31cfbc..0000000000 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_ui_reset_timeout_notification.cc +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2018, Ford Motor Company - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following - * disclaimer in the documentation and/or other materials provided with the - * distribution. - * - * Neither the name of the Ford Motor Company nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#include "sdl_rpc_plugin/commands/hmi/on_ui_reset_timeout_notification.h" -#include "application_manager/event_engine/event.h" -#include "interfaces/HMI_API.h" - -namespace sdl_rpc_plugin { -using namespace application_manager; - -namespace commands { - -namespace hmi { - -SDL_CREATE_LOG_VARIABLE("Commands") - -OnUIResetTimeoutNotification::OnUIResetTimeoutNotification( - const application_manager::commands::MessageSharedPtr& message, - ApplicationManager& application_manager, - rpc_service::RPCService& rpc_service, - HMICapabilities& hmi_capabilities, - policy::PolicyHandlerInterface& policy_handle) - : NotificationFromHMI(message, - application_manager, - rpc_service, - hmi_capabilities, - policy_handle) {} - -OnUIResetTimeoutNotification::~OnUIResetTimeoutNotification() {} - -void OnUIResetTimeoutNotification::Run() { - SDL_LOG_AUTO_TRACE(); - - event_engine::Event event(hmi_apis::FunctionID::UI_OnResetTimeout); - event.set_smart_object(*message_); - event.raise(application_manager_.event_dispatcher()); -} - -} // namespace hmi - -} // namespace commands - -} // namespace sdl_rpc_plugin diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_request.cc index 66ac9c458b..4de8b17b8d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/sdl_activate_app_request.cc @@ -142,7 +142,7 @@ void SDLActivateAppRequest::Run() { application_manager_.get_settings(); uint32_t total_retry_timeout = (settings.cloud_app_retry_timeout() * settings.cloud_app_max_retry_attempts()); - application_manager_.updateRequestTimeout( + application_manager_.UpdateRequestTimeout( 0, correlation_id(), default_timeout_ + total_retry_timeout); subscribe_on_event(BasicCommunication_OnAppRegistered); application_manager_.connection_handler().ConnectToDevice(app->device()); @@ -227,7 +227,7 @@ void SDLActivateAppRequest::Run() { application_manager_.get_settings(); uint32_t total_retry_timeout = (settings.cloud_app_retry_timeout() * settings.cloud_app_max_retry_attempts()); - application_manager_.updateRequestTimeout( + application_manager_.UpdateRequestTimeout( 0, correlation_id(), default_timeout_ + total_retry_timeout); subscribe_on_event(BasicCommunication_OnAppRegistered); application_manager_.connection_handler().ConnectToDevice( diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_request.cc index 8728bb4403..0e0d91f05d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_maneuver_request.cc @@ -51,9 +51,7 @@ AlertManeuverRequest::AlertManeuverRequest( hmi_capabilities, policy_handler) , tts_speak_result_code_(hmi_apis::Common_Result::INVALID_ENUM) - , navi_alert_maneuver_result_code_(hmi_apis::Common_Result::INVALID_ENUM) { - subscribe_on_event(hmi_apis::FunctionID::TTS_OnResetTimeout); -} + , navi_alert_maneuver_result_code_(hmi_apis::Common_Result::INVALID_ENUM) {} AlertManeuverRequest::~AlertManeuverRequest() {} @@ -179,13 +177,7 @@ void AlertManeuverRequest::on_event(const event_engine::Event& event) { GetInfo(message, info_tts_); break; } - case hmi_apis::FunctionID::TTS_OnResetTimeout: { - SDL_LOG_INFO("Received TTS_OnResetTimeout event"); - application_manager_.updateRequestTimeout( - connection_key(), correlation_id(), default_timeout()); - break; - } default: { SDL_LOG_ERROR("Received unknown event " << event.id()); SendResponse( diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_request.cc index 5d1a058f16..26c209bf2a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/alert_request.cc @@ -65,10 +65,7 @@ AlertRequest::AlertRequest( , awaiting_tts_stop_speaking_response_(false) , is_ui_alert_sent_(false) , alert_result_(hmi_apis::Common_Result::INVALID_ENUM) - , tts_speak_result_(hmi_apis::Common_Result::INVALID_ENUM) { - subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout); - subscribe_on_event(hmi_apis::FunctionID::TTS_OnResetTimeout); -} + , tts_speak_result_(hmi_apis::Common_Result::INVALID_ENUM) {} AlertRequest::~AlertRequest() {} @@ -129,18 +126,6 @@ void AlertRequest::on_event(const event_engine::Event& event) { const smart_objects::SmartObject& message = event.smart_object(); switch (event.id()) { - case hmi_apis::FunctionID::TTS_OnResetTimeout: - case hmi_apis::FunctionID::UI_OnResetTimeout: { - SDL_LOG_INFO( - "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; - } case hmi_apis::FunctionID::UI_Alert: { SDL_LOG_INFO("Received UI_Alert event"); // Unsubscribe from event to avoid unwanted messages diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc index f3e0b67921..2f624efe76 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/create_interaction_choice_set_request.cc @@ -369,7 +369,7 @@ void CreateInteractionChoiceSetRequest::CountReceivedVRResponses() { << expected_chs_count_ - received_chs_count_ << " more to wait."); if (received_chs_count_ < expected_chs_count_) { - application_manager_.updateRequestTimeout( + application_manager_.UpdateRequestTimeout( connection_key(), correlation_id(), default_timeout()); SDL_LOG_DEBUG("Timeout for request was updated"); } else { diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_request.cc index 54b542d245..9e156bf755 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/get_way_points_request.cc @@ -51,9 +51,7 @@ GetWayPointsRequest::GetWayPointsRequest( application_manager, rpc_service, hmi_capabilities, - policy_handler) { - subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout); -} + policy_handler) {} GetWayPointsRequest::~GetWayPointsRequest() {} @@ -81,12 +79,6 @@ void GetWayPointsRequest::on_event(const event_engine::Event& event) { SDL_LOG_AUTO_TRACE(); const smart_objects::SmartObject& message = event.smart_object(); switch (event.id()) { - case hmi_apis::FunctionID::UI_OnResetTimeout: { - SDL_LOG_INFO("Received UI_OnResetTimeout event"); - application_manager_.updateRequestTimeout( - connection_key(), correlation_id(), default_timeout()); - break; - } case hmi_apis::FunctionID::Navigation_GetWayPoints: { SDL_LOG_INFO("Received Navigation_GetWayPoints event"); EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_Navigation); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_request.cc index 0accdd1e76..74b474f76b 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_audio_pass_thru_request.cc @@ -59,9 +59,7 @@ PerformAudioPassThruRequest::PerformAudioPassThruRequest( hmi_capabilities, policy_handler) , result_tts_speak_(hmi_apis::Common_Result::INVALID_ENUM) - , result_ui_(hmi_apis::Common_Result::INVALID_ENUM) { - subscribe_on_event(hmi_apis::FunctionID::TTS_OnResetTimeout); -} + , result_ui_(hmi_apis::Common_Result::INVALID_ENUM) {} PerformAudioPassThruRequest::~PerformAudioPassThruRequest() {} @@ -183,18 +181,12 @@ void PerformAudioPassThruRequest::on_event(const event_engine::Event& event) { StartMicrophoneRecording(); // update request timeout to get time for perform audio recording - application_manager_.updateRequestTimeout( + application_manager_.UpdateRequestTimeout( connection_key(), correlation_id(), default_timeout()); } break; } - case hmi_apis::FunctionID::TTS_OnResetTimeout: { - SDL_LOG_INFO("Received TTS_OnResetTimeout event"); - application_manager_.updateRequestTimeout( - connection_key(), correlation_id(), default_timeout()); - break; - } default: { SDL_LOG_ERROR("Received unknown event " << event.id()); return; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc index bb990574bd..da1f744689 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/perform_interaction_request.cc @@ -83,7 +83,6 @@ PerformInteractionRequest::PerformInteractionRequest( , ui_result_code_(hmi_apis::Common_Result::INVALID_ENUM) { response_msg_params = smart_objects::SmartObject(smart_objects::SmartType_Map); - subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout); subscribe_on_event(hmi_apis::FunctionID::VR_OnCommand); subscribe_on_event(hmi_apis::FunctionID::Buttons_OnButtonPress); } @@ -236,12 +235,6 @@ void PerformInteractionRequest::on_event(const event_engine::Event& event) { const smart_objects::SmartObject& message = event.smart_object(); switch (event.id()) { - case hmi_apis::FunctionID::UI_OnResetTimeout: { - SDL_LOG_DEBUG("Received UI_OnResetTimeout event"); - application_manager_.updateRequestTimeout( - connection_key(), correlation_id(), default_timeout()); - break; - } case hmi_apis::FunctionID::UI_PerformInteraction: { SDL_LOG_DEBUG("Received UI_PerformInteraction event"); EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); @@ -299,7 +292,7 @@ void PerformInteractionRequest::onTimeOut() { DisablePerformInteraction(); CommandRequestImpl::onTimeOut(); } else { - application_manager_.updateRequestTimeout( + application_manager_.UpdateRequestTimeout( connection_key(), correlation_id(), default_timeout_); } break; @@ -351,8 +344,10 @@ bool PerformInteractionRequest::ProcessVRResponse( SendResponse(false, MessageHelper::HMIToMobileResult(vr_result_code_)); return true; } + SDL_LOG_DEBUG("Update timeout for UI"); - application_manager_.updateRequestTimeout( + application_manager_.UpdateRequestTimeout( + connection_key(), correlation_id(), default_timeout_); return false; } @@ -378,7 +373,7 @@ bool PerformInteractionRequest::ProcessVRResponse( if (mobile_apis::InteractionMode::BOTH == interaction_mode_ || mobile_apis::InteractionMode::MANUAL_ONLY == interaction_mode_) { SDL_LOG_DEBUG("Update timeout for UI"); - application_manager_.updateRequestTimeout( + application_manager_.UpdateRequestTimeout( connection_key(), correlation_id(), default_timeout_); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_request.cc index 89e77d9d19..7cfe5f5414 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/scrollable_message_request.cc @@ -58,9 +58,7 @@ ScrollableMessageRequest::ScrollableMessageRequest( application_manager, rpc_service, hmi_capabilities, - policy_handler) { - subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout); -} + policy_handler) {} ScrollableMessageRequest::~ScrollableMessageRequest() {} @@ -131,12 +129,6 @@ void ScrollableMessageRequest::on_event(const event_engine::Event& event) { const smart_objects::SmartObject& message = event.smart_object(); switch (event.id()) { - case hmi_apis::FunctionID::UI_OnResetTimeout: { - SDL_LOG_INFO("Received UI_OnResetTimeout event"); - application_manager_.updateRequestTimeout( - connection_key(), correlation_id(), default_timeout()); - break; - } case hmi_apis::FunctionID::UI_ScrollableMessage: { SDL_LOG_INFO("Received UI_ScrollableMessage event"); EndAwaitForInterface(HmiInterfaces::HMI_INTERFACE_UI); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_request.cc index 22935e2136..0fdc412572 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/slider_request.cc @@ -55,9 +55,7 @@ SliderRequest::SliderRequest( application_manager, rpc_service, hmi_capabilities, - policy_handler) { - subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout); -} + policy_handler) {} SliderRequest::~SliderRequest() {} @@ -65,8 +63,7 @@ bool SliderRequest::Init() { /* Timeout in milliseconds. If omitted a standard value of 10000 milliseconds is used.*/ if ((*message_)[strings::msg_params].keyExists(strings::timeout)) { - default_timeout_ = - application_manager_.get_settings().default_timeout() + + default_timeout_ += (*message_)[strings::msg_params][strings::timeout].asUInt(); } @@ -134,12 +131,6 @@ void SliderRequest::on_event(const event_engine::Event& event) { const SmartObject& message = event.smart_object(); const event_engine::Event::EventID event_id = event.id(); - if (event_id == FunctionID::UI_OnResetTimeout) { - SDL_LOG_INFO("Received UI_OnResetTimeout event"); - application_manager_.updateRequestTimeout( - connection_key(), correlation_id(), default_timeout()); - return; - } if (event_id != FunctionID::UI_Slider) { SDL_LOG_ERROR("Received unknown event " << event.id()); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_request.cc index b8de053853..f8307f8355 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/speak_request.cc @@ -55,9 +55,7 @@ SpeakRequest::SpeakRequest( application_manager, rpc_service, hmi_capabilities, - policy_handler) { - subscribe_on_event(hmi_apis::FunctionID::TTS_OnResetTimeout); -} + policy_handler) {} SpeakRequest::~SpeakRequest() {} @@ -112,13 +110,7 @@ void SpeakRequest::on_event(const event_engine::Event& event) { ProcessTTSSpeakResponse(event.smart_object()); break; } - case hmi_apis::FunctionID::TTS_OnResetTimeout: { - SDL_LOG_INFO("Received TTS_OnResetTimeout event"); - application_manager_.updateRequestTimeout( - connection_key(), correlation_id(), default_timeout()); - break; - } default: { SDL_LOG_ERROR("Received unknown event " << event.id()); break; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subtle_alert_request.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subtle_alert_request.cc index 2a8e267436..8491a859e6 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subtle_alert_request.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/subtle_alert_request.cc @@ -59,10 +59,7 @@ SubtleAlertRequest::SubtleAlertRequest( , is_ui_subtle_alert_sent_(false) , is_tts_stop_speaking_sent_(false) , subtle_alert_result_(hmi_apis::Common_Result::INVALID_ENUM) - , tts_speak_result_(hmi_apis::Common_Result::INVALID_ENUM) { - subscribe_on_event(hmi_apis::FunctionID::UI_OnResetTimeout); - subscribe_on_event(hmi_apis::FunctionID::TTS_OnResetTimeout); -} + , tts_speak_result_(hmi_apis::Common_Result::INVALID_ENUM) {} SubtleAlertRequest::~SubtleAlertRequest() {} @@ -118,18 +115,6 @@ void SubtleAlertRequest::on_event(const event_engine::Event& event) { const smart_objects::SmartObject& message = event.smart_object(); switch (event.id()) { - case hmi_apis::FunctionID::TTS_OnResetTimeout: - case hmi_apis::FunctionID::UI_OnResetTimeout: { - SDL_LOG_INFO( - "Received UI_OnResetTimeout event " - " or TTS_OnResetTimeout event" - << awaiting_tts_speak_response_ << " " - << awaiting_tts_stop_speaking_response_ << " " - << awaiting_ui_subtle_alert_response_); - application_manager_.updateRequestTimeout( - connection_key(), correlation_id(), default_timeout()); - break; - } case hmi_apis::FunctionID::UI_SubtleAlert: { SDL_LOG_INFO("Received UI_SubtleAlert event"); // Unsubscribe from event to avoid unwanted messages diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc index 642bdc7b11..954ddb4e57 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/hmi_command_factory.cc @@ -218,6 +218,7 @@ #include "sdl_rpc_plugin/commands/hmi/on_ready_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_received_policy_update.h" #include "sdl_rpc_plugin/commands/hmi/on_record_start_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_reset_timeout_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_sdl_close_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_sdl_persistence_complete_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_system_context_notification.h" @@ -225,13 +226,11 @@ #include "sdl_rpc_plugin/commands/hmi/on_system_request_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_system_time_ready_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_tts_language_change_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_tts_reset_timeout_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_tts_started_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_tts_stopped_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_ui_command_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_ui_keyboard_input_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_ui_language_change_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_ui_reset_timeout_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_ui_subtle_alert_pressed_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_ui_touch_event_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_ui_update_file_notification.h" @@ -775,8 +774,8 @@ CommandCreator& HMICommandFactory::get_creator_factory( case hmi_apis::FunctionID::UI_OnTouchEvent: { return factory.GetCreator<commands::hmi::OnUITouchEventNotification>(); } - case hmi_apis::FunctionID::UI_OnResetTimeout: { - return factory.GetCreator<commands::hmi::OnUIResetTimeoutNotification>(); + case hmi_apis::FunctionID::BasicCommunication_OnResetTimeout: { + return factory.GetCreator<commands::hmi::OnResetTimeoutNotification>(); } case hmi_apis::FunctionID::Navigation_SetVideoConfig: { return hmi_apis::messageType::request == message_type @@ -875,9 +874,6 @@ CommandCreator& HMICommandFactory::get_creator_factory( case hmi_apis::FunctionID::SDL_OnDeviceStateChanged: { return factory.GetCreator<commands::OnDeviceStateChangedNotification>(); } - case hmi_apis::FunctionID::TTS_OnResetTimeout: { - return factory.GetCreator<commands::hmi::OnTTSResetTimeoutNotification>(); - } case hmi_apis::FunctionID::BasicCommunication_OnEventChanged: { return factory.GetCreator<commands::OnEventChangedNotification>(); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc index 5fa910b2d9..5e485adb7f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/dummy_hmi_commands_test.cc @@ -114,6 +114,7 @@ #include "hmi/on_ready_notification.h" #include "hmi/on_received_policy_update.h" #include "hmi/on_record_start_notification.h" +#include "hmi/on_reset_timeout_notification.h" #include "hmi/on_resume_audio_source_notification.h" #include "hmi/on_sdl_close_notification.h" #include "hmi/on_sdl_consent_needed_notification.h" @@ -125,13 +126,11 @@ #include "hmi/on_system_info_changed_notification.h" #include "hmi/on_system_request_notification.h" #include "hmi/on_tts_language_change_notification.h" -#include "hmi/on_tts_reset_timeout_notification.h" #include "hmi/on_tts_started_notification.h" #include "hmi/on_tts_stopped_notification.h" #include "hmi/on_ui_command_notification.h" #include "hmi/on_ui_keyboard_input_notification.h" #include "hmi/on_ui_language_change_notification.h" -#include "hmi/on_ui_reset_timeout_notification.h" #include "hmi/on_ui_touch_event_notification.h" #include "hmi/on_update_device_list.h" #include "hmi/on_video_data_streaming_notification.h" @@ -258,14 +257,10 @@ class HMICommandsTest : public components::commands_test::CommandRequestTest< typedef Command CommandType; void InitCommand(const uint32_t& timeout) OVERRIDE { + CommandRequestTest<kIsNice>::InitCommand(timeout); + stream_retry_.first = 0; stream_retry_.second = 0; - EXPECT_CALL(app_mngr_settings_, default_timeout()) - .WillOnce(ReturnRef(timeout)); - ON_CALL(app_mngr_, event_dispatcher()) - .WillByDefault(ReturnRef(event_dispatcher_)); - ON_CALL(app_mngr_, get_settings()) - .WillByDefault(ReturnRef(app_mngr_settings_)); ON_CALL(app_mngr_settings_, start_stream_retry_amount()) .WillByDefault(ReturnRef(stream_retry_)); } @@ -454,7 +449,6 @@ typedef Types<commands::hmi::OnButtonEventNotification, commands::OnNaviTBTClientStateNotification, commands::hmi::OnUIKeyBoardInputNotification, commands::hmi::OnUITouchEventNotification, - commands::hmi::OnUIResetTimeoutNotification, commands::NaviStartStreamResponse, commands::NaviStartStreamRequest, commands::NaviStopStreamResponse, @@ -485,7 +479,7 @@ typedef Types<commands::hmi::OnButtonEventNotification, commands::OnReceivedPolicyUpdate, commands::OnPolicyUpdate, commands::OnDeviceStateChangedNotification, - commands::hmi::OnTTSResetTimeoutNotification, + commands::hmi::OnResetTimeoutNotification, commands::hmi::DialNumberResponse, commands::hmi::DialNumberRequest, commands::OnEventChangedNotification, diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc index 5487da51a3..bb5008654a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/hmi_notifications_test.cc @@ -61,6 +61,7 @@ #include "sdl_rpc_plugin/commands/hmi/on_ready_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_received_policy_update.h" #include "sdl_rpc_plugin/commands/hmi/on_record_start_notification.h" +#include "sdl_rpc_plugin/commands/hmi/on_reset_timeout_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_resume_audio_source_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_sdl_close_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_sdl_consent_needed_notification.h" @@ -72,13 +73,11 @@ #include "sdl_rpc_plugin/commands/hmi/on_system_info_changed_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_system_request_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_tts_language_change_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_tts_reset_timeout_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_tts_started_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_tts_stopped_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_ui_command_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_ui_keyboard_input_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_ui_language_change_notification.h" -#include "sdl_rpc_plugin/commands/hmi/on_ui_reset_timeout_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_ui_subtle_alert_pressed_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_ui_touch_event_notification.h" #include "sdl_rpc_plugin/commands/hmi/on_video_data_streaming_notification.h" @@ -257,13 +256,9 @@ class HMICommandsNotificationsTest MockAppServiceManager mock_app_service_manager_; void InitCommand(const uint32_t& default_timeout) OVERRIDE { + CommandsTest<kIsNice>::InitCommand(default_timeout); + app_ = ConfigureApp(&app_ptr_, kAppId_, NOT_MEDIA, NOT_NAVI, NOT_VC); - EXPECT_CALL(app_mngr_, get_settings()) - .WillOnce(ReturnRef(app_mngr_settings_)); - EXPECT_CALL(app_mngr_settings_, default_timeout()) - .WillOnce(ReturnRef(default_timeout)); - ON_CALL(app_mngr_, event_dispatcher()) - .WillByDefault(ReturnRef(mock_event_dispatcher_)); ON_CALL(app_mngr_, application_by_hmi_app(_)).WillByDefault(Return(app_)); ON_CALL(*app_ptr_, app_id()).WillByDefault(Return(kAppId_)); ON_CALL(app_mngr_, application(kConnectionKey)).WillByDefault(Return(app_)); @@ -362,12 +357,10 @@ typedef Types< hmi_apis::FunctionID::BasicCommunication_OnAppDeactivated>, CommandPair<OnEventChangedNotification, hmi_apis::FunctionID::BasicCommunication_OnEventChanged>, - CommandPair<hmi::OnTTSResetTimeoutNotification, - hmi_apis::FunctionID::TTS_OnResetTimeout>, + CommandPair<hmi::OnResetTimeoutNotification, + hmi_apis::FunctionID::BasicCommunication_OnResetTimeout>, CommandPair<OnTTSStartedNotification, hmi_apis::FunctionID::TTS_Started>, CommandPair<OnTTSStoppedNotification, hmi_apis::FunctionID::TTS_Stopped>, - CommandPair<hmi::OnUIResetTimeoutNotification, - hmi_apis::FunctionID::UI_OnResetTimeout>, CommandPair<OnVRStartedNotification, hmi_apis::FunctionID::VR_Started>, CommandPair<OnVRStoppedNotification, hmi_apis::FunctionID::VR_Stopped> > HMIOnNotificationsEventDispatcherTypes; @@ -517,7 +510,8 @@ TEST_F(HMICommandsNotificationsTest, std::shared_ptr<Command> command = CreateCommand<OnAppRegisteredNotification>(message); EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_)); - EXPECT_CALL(app_mngr_, event_dispatcher()); + EXPECT_CALL(app_mngr_, event_dispatcher()) + .WillOnce(ReturnRef(mock_event_dispatcher_)); EXPECT_CALL(mock_event_dispatcher_, raise_event(_)) .WillOnce(GetEventId(&event_id)); command->Run(); @@ -539,7 +533,8 @@ TEST_F(HMICommandsNotificationsTest, std::shared_ptr<Command> command = CreateCommand<OnAppUnregisteredNotification>(message); EXPECT_CALL(mock_rpc_service_, SendMessageToHMI(_)); - EXPECT_CALL(app_mngr_, event_dispatcher()); + EXPECT_CALL(app_mngr_, event_dispatcher()) + .WillOnce(ReturnRef(mock_event_dispatcher_)); EXPECT_CALL(mock_event_dispatcher_, raise_event(_)) .WillOnce(GetEventId(&event_id)); command->Run(); @@ -561,7 +556,8 @@ TEST_F(HMICommandsNotificationsTest, OnButtonPressNotificationEventDispatcher) { CreateCommand<hmi::OnButtonPressNotification>(message); EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, Command::CommandSource::SOURCE_SDL)); - EXPECT_CALL(app_mngr_, event_dispatcher()); + EXPECT_CALL(app_mngr_, event_dispatcher()) + .WillOnce(ReturnRef(mock_event_dispatcher_)); EXPECT_CALL(mock_event_dispatcher_, raise_event(_)) .WillOnce(GetEventId(&event_id)); command->Run(); @@ -578,7 +574,8 @@ TEST_F(HMICommandsNotificationsTest, OnReadyNotificationEventDispatcher) { CreateCommand<OnReadyNotification>(message); EXPECT_CALL(app_mngr_, OnHMIReady()); - EXPECT_CALL(app_mngr_, event_dispatcher()); + EXPECT_CALL(app_mngr_, event_dispatcher()) + .WillOnce(ReturnRef(mock_event_dispatcher_)); EXPECT_CALL(mock_event_dispatcher_, raise_event(_)) .WillOnce(GetEventId(&event_id)); command->Run(); @@ -1298,11 +1295,10 @@ TEST_F(HMICommandsNotificationsTest, EXPECT_CALL(app_mngr_, application(_)).WillOnce(Return(app_)); EXPECT_CALL(app_mngr_settings_, max_cmd_id()).WillOnce(ReturnRef(kMaxCmdId)); - EXPECT_CALL(app_mngr_, get_settings()) - .WillOnce(ReturnRef(app_mngr_settings_)); EXPECT_CALL(*app_ptr_, is_perform_interaction_active()) .WillOnce(Return(kIsPerformInteractionActive)); - EXPECT_CALL(app_mngr_, event_dispatcher()); + EXPECT_CALL(app_mngr_, event_dispatcher()) + .WillOnce(ReturnRef(mock_event_dispatcher_)); EXPECT_CALL(mock_event_dispatcher_, raise_event(_)) .WillOnce(GetEventId(&event_id)); EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_request_test.cc index 31285f5b17..a2dc705f60 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/hmi/sdl_activate_app_request_test.cc @@ -113,8 +113,9 @@ class SDLActivateAppRequestTest } void InitCommand(const uint32_t& timeout) OVERRIDE { - MockAppPtr mock_app = CreateMockApp(); CommandRequestTest<CommandsTestMocks::kIsNice>::InitCommand(timeout); + + MockAppPtr mock_app = CreateMockApp(); ON_CALL((*mock_app), app_id()).WillByDefault(Return(kAppID)); ON_CALL(app_mngr_, application_by_hmi_app(kAppID)) .WillByDefault(Return(mock_app)); @@ -486,7 +487,7 @@ TEST_F(SDLActivateAppRequestTest, WaitingCloudApplication_ConnectDevice) { EXPECT_CALL(app_mngr_, get_settings()).WillOnce(ReturnRef(settings)); EXPECT_CALL(app_mngr_, - updateRequestTimeout(0, kCorrelationID, Gt(kMinimumTimeout))); + UpdateRequestTimeout(0, kCorrelationID, Gt(kMinimumTimeout))); MockConnectionHandler connection_handler; EXPECT_CALL(connection_handler, ConnectToDevice(kHandle)); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_request_test.cc index 5e1f3e4782..9130fa52a0 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/alert_request_test.cc @@ -403,27 +403,6 @@ TEST_F(AlertRequestTest, OnEvent_InvalidEventId_UNSUCCESS) { command->on_event(event); } -TEST_F(AlertRequestTest, DISABLED_OnEvent_UI_OnResetTimeout_SUCCESS) { - PreConditions(); - Expectations(); - AddAlertTextsToMsg(); - - (*msg_)[am::strings::msg_params][am::strings::duration] = kDefaultTimeout; - - CommandPtr command(CreateCommand<AlertRequest>(msg_)); - EXPECT_TRUE(command->Init()); - - EXPECT_CALL( - app_mngr_, - updateRequestTimeout(kConnectionKey, kCorrelationId, kDefaultTimeout)); - - ExpectManageMobileCommandWithResultCode(mobile_apis::Result::INVALID_ENUM); - - Event event(hmi_apis::FunctionID::UI_OnResetTimeout); - event.set_smart_object(*msg_); - command->on_event(event); -} - TEST_F(AlertRequestTest, OnEvent_UIAlertHasHmiResponsesToWait_UNSUCCESS) { Expectations(); AddAlertTextsToMsg(); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_interaction_choice_set_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_interaction_choice_set_test.cc index 80abfec61d..d77e0588f8 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_interaction_choice_set_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/create_interaction_choice_set_test.cc @@ -619,7 +619,7 @@ TEST_F(CreateInteractionChoiceSetRequestTest, OnEvent_ValidVrNoError_SUCCESS) { command_->Run(); - EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)); + EXPECT_CALL(app_mngr_, UpdateRequestTimeout(_, _, _)); EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)).Times(0); event.set_smart_object(*message_); @@ -655,7 +655,7 @@ TEST_F(CreateInteractionChoiceSetRequestTest, .WillByDefault(Return(kCorrelationId)); command_->Run(); - EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)); + EXPECT_CALL(app_mngr_, UpdateRequestTimeout(_, _, _)); EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)).Times(0); event.set_smart_object(*message_); @@ -696,7 +696,7 @@ TEST_F(CreateInteractionChoiceSetRequestTest, FillMessageFieldsItem2(message_); - EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0); + EXPECT_CALL(app_mngr_, UpdateRequestTimeout(_, _, _)).Times(0); EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)); event.set_smart_object(*message_); command_->on_event(event); @@ -751,7 +751,7 @@ TEST_F(CreateInteractionChoiceSetRequestTest, command_->Run(); FillMessageFieldsItem2(message_); - EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0); + EXPECT_CALL(app_mngr_, UpdateRequestTimeout(_, _, _)).Times(0); EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)); Event event(hmi_apis::FunctionID::VR_AddCommand); event.set_smart_object(*message_); @@ -801,7 +801,7 @@ TEST_F(CreateInteractionChoiceSetRequestTest, OnTimeOut_InvalidApp_UNSUCCESS) { command_->Run(); FillMessageFieldsItem2(message_); - EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0); + EXPECT_CALL(app_mngr_, UpdateRequestTimeout(_, _, _)).Times(0); EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)).Times(2); Event event(hmi_apis::FunctionID::VR_AddCommand); event.set_smart_object(*message_); @@ -854,7 +854,7 @@ TEST_F(CreateInteractionChoiceSetRequestTest, FillMessageFieldsItem2(message_); - EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0); + EXPECT_CALL(app_mngr_, UpdateRequestTimeout(_, _, _)).Times(0); resumption_test::MockResumeCtrl mock_resume_ctrl; EXPECT_CALL(app_mngr_, resume_controller()) .WillOnce(ReturnRef(mock_resume_ctrl)); @@ -935,7 +935,7 @@ TEST_F(CreateInteractionChoiceSetRequestTest, Run_ErrorFromHmiFalse_UNSUCCESS) { ManageMobileCommand( MobileResultCodeIs(mobile_apis::Result::GENERIC_ERROR), am::commands::Command::SOURCE_SDL)); - EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0); + EXPECT_CALL(app_mngr_, UpdateRequestTimeout(_, _, _)).Times(0); EXPECT_CALL(app_mngr_, TerminateRequest(_, _, _)); event.set_smart_object(*message_); command_->on_event(event); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc index 8f83a2dd10..201118eec0 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/dummy_mobile_commands_test.cc @@ -165,12 +165,8 @@ class MobileCommandsTest : public components::commands_test::CommandRequestTest< typedef Command CommandType; void InitCommand(const uint32_t& timeout) OVERRIDE { - EXPECT_CALL(app_mngr_settings_, default_timeout()) - .WillOnce(ReturnRef(timeout)); - ON_CALL(app_mngr_, event_dispatcher()) - .WillByDefault(ReturnRef(event_dispatcher_)); - ON_CALL(app_mngr_, get_settings()) - .WillByDefault(ReturnRef(app_mngr_settings_)); + CommandRequestTest<CommandsTestMocks::kIsNice>::InitCommand(timeout); + ON_CALL(app_mngr_settings_, app_icons_folder()) .WillByDefault(ReturnRef(kEmptyString_)); } diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_way_points_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_way_points_request_test.cc index 7f7a8b55bd..fd2bc2e51a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_way_points_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/get_way_points_request_test.cc @@ -202,7 +202,7 @@ TEST_F(GetWayPointsRequestTest, OnEvent_DefaultCase) { event.set_smart_object(*message_); - EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0); + EXPECT_CALL(app_mngr_, UpdateRequestTimeout(_, _, _)).Times(0); EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).Times(0); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_audio_pass_thru_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_audio_pass_thru_test.cc index 2915418d43..c7627b7e55 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_audio_pass_thru_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/perform_audio_pass_thru_test.cc @@ -626,7 +626,7 @@ TEST_F(PerformAudioPassThruRequestTest, EXPECT_CALL(app_mngr_, BeginAudioPassThru(app_id)); EXPECT_CALL(app_mngr_, StartAudioPassThruThread(_, _, _, _, _, _)); - EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)); + EXPECT_CALL(app_mngr_, UpdateRequestTimeout(_, _, _)); ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); @@ -654,7 +654,7 @@ TEST_F(PerformAudioPassThruRequestTest, ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); // First call on_event for setting result_tts_speak_ to UNSUPPORTED_RESOURCE - EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)); + EXPECT_CALL(app_mngr_, UpdateRequestTimeout(_, _, _)); CallOnEvent caller_speak(*command_sptr_, event_speak); caller_speak(); @@ -691,31 +691,7 @@ TEST_F(PerformAudioPassThruRequestTest, app_mngr_, StartAudioPassThruThread(kConnectionKey, kCorrelationId, _, _, _, _)); - EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)); - ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) - .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); - CallOnEvent caller(*command_sptr_, event); - caller(); - - EXPECT_EQ(kConnectionKey, msg_params_[am::strings::connection_key].asUInt()); - EXPECT_EQ(kFunctionId, msg_params_[am::strings::function_id].asString()); -} - -TEST_F(PerformAudioPassThruRequestTest, - DISABLED_OnEvent_TTSOnResetTimeout_UpdateTimeout) { - am::event_engine::Event event(hmi_apis::FunctionID::TTS_OnResetTimeout); - - msg_params_[am::strings::connection_key] = kConnectionKey; - msg_params_[am::strings::function_id] = kFunctionId; - - uint32_t app_id = kConnectionKey; - EXPECT_CALL(mock_rpc_service_, ManageHMICommand(_, _)).WillOnce(Return(true)); - EXPECT_CALL(app_mngr_, BeginAudioPassThru(app_id)).WillOnce(Return(true)); - - EXPECT_CALL( - app_mngr_, - StartAudioPassThruThread(kConnectionKey, kCorrelationId, _, _, _, _)); - EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)); + EXPECT_CALL(app_mngr_, UpdateRequestTimeout(_, _, _)); ON_CALL(mock_hmi_interfaces_, GetInterfaceState(_)) .WillByDefault(Return(am::HmiInterfaces::STATE_AVAILABLE)); CallOnEvent caller(*command_sptr_, event); @@ -729,7 +705,7 @@ TEST_F(PerformAudioPassThruRequestTest, OnEvent_DefaultCase) { am::event_engine::Event event(hmi_apis::FunctionID::INVALID_ENUM); uint32_t app_id = kConnectionKey; - EXPECT_CALL(app_mngr_, updateRequestTimeout(_, _, _)).Times(0); + EXPECT_CALL(app_mngr_, UpdateRequestTimeout(_, _, _)).Times(0); EXPECT_CALL(app_mngr_, EndAudioPassThru(app_id)).Times(0); CallOnEvent caller(*command_sptr_, event); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc index 4572a6d907..99491873be 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/register_app_interface_request_test.cc @@ -416,6 +416,7 @@ TEST_F(RegisterAppInterfaceRequestTest, DefaultTimeout_CheckIfZero_SUCCESS) { TEST_F(RegisterAppInterfaceRequestTest, Run_MinimalData_SUCCESS) { InitBasicMessage(); (*msg_)[am::strings::msg_params][am::strings::hash_id] = kAppId1; + EXPECT_CALL(app_mngr_, WaitForHmiIsReady()).WillOnce(Return(true)); EXPECT_CALL(app_mngr_, IsApplicationForbidden(_, _)).WillOnce(Return(false)); @@ -501,6 +502,7 @@ TEST_F(RegisterAppInterfaceRequestTest, InitBasicMessage(); ON_CALL(app_mngr_, WaitForHmiIsReady()).WillByDefault(Return(true)); + EXPECT_CALL(app_mngr_, IsApplicationForbidden(_, _)).WillOnce(Return(false)); ON_CALL(mock_connection_handler_, @@ -802,6 +804,7 @@ TEST_F(RegisterAppInterfaceRequestTest, (*msg_)[am::strings::params][am::strings::connection_key] = kConnectionKey2; ON_CALL(app_mngr_, WaitForHmiIsReady()).WillByDefault(Return(true)); + EXPECT_CALL(app_mngr_, IsApplicationForbidden(kConnectionKey2, kAppId1)) .WillOnce(Return(false)); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/scrollable_message_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/scrollable_message_test.cc index 6b17aa238d..443868168d 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/scrollable_message_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/scrollable_message_test.cc @@ -173,17 +173,21 @@ TEST_F(ScrollableMessageRequestTest, Init_CorrectTimeout_SUCCESS) { (*msg_)[msg_params][timeout] = kTimeOut; (*msg_)[msg_params][interaction_mode] = mobile_apis::InteractionMode::MANUAL_ONLY; - EXPECT_EQ(kDefaultTimeout_, command_->default_timeout()); + const uint32_t initial_timeout = + kDefaultTimeout_ + kDefaultTimeoutCompensation_; + EXPECT_EQ(initial_timeout, command_->default_timeout()); command_->Init(); - EXPECT_EQ(kTimeOut + kDefaultTimeout_, command_->default_timeout()); + EXPECT_EQ(kTimeOut + initial_timeout, command_->default_timeout()); } TEST_F(ScrollableMessageRequestTest, Init_CorrectTimeout_UNSUCCESS) { (*msg_)[msg_params][interaction_mode] = mobile_apis::InteractionMode::MANUAL_ONLY; - EXPECT_EQ(kDefaultTimeout_, command_->default_timeout()); + const uint32_t initial_timeout = + kDefaultTimeout_ + kDefaultTimeoutCompensation_; + EXPECT_EQ(initial_timeout, command_->default_timeout()); command_->Init(); - EXPECT_EQ(kDefaultTimeout_, command_->default_timeout()); + EXPECT_EQ(initial_timeout, command_->default_timeout()); } TEST_F(ScrollableMessageRequestTest, Run_ApplicationIsNotRegistered_UNSUCCESS) { @@ -241,18 +245,6 @@ TEST_F(ScrollableMessageRequestTest, OnEvent_ReceivedUnknownEvent_UNSUCCESS) { } TEST_F(ScrollableMessageRequestTest, - OnEvent_ReceivedUIOnResetTimeoutEvent_SUCCESS) { - (*msg_)[params][connection_key] = kConnectionKey; - (*msg_)[params][correlation_id] = kCorrelationId; - EXPECT_CALL( - app_mngr_, - updateRequestTimeout(kConnectionKey, kCorrelationId, kDefaultTimeout_)); - Event event(hmi_apis::FunctionID::UI_OnResetTimeout); - event.set_smart_object(*msg_); - command_->on_event(event); -} - -TEST_F(ScrollableMessageRequestTest, DISABLED_OnEvent_ReceivedUIScrollableMessage_SUCCESS) { (*msg_)[params][hmi_response::code] = hmi_apis::Common_Result::SUCCESS; diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/slider_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/slider_test.cc index 0450f06ee1..d9bffc6b4a 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/slider_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/slider_test.cc @@ -274,22 +274,6 @@ TEST_F(SliderRequestTest, Run_SUCCESS) { command->Run(); } -TEST_F(SliderRequestTest, OnEvent_UI_OnResetTimeout_UNSUCCESS) { - PreConditions(); - (*msg_)[am::strings::msg_params][am::strings::timeout] = kDefaultTimeout; - (*msg_)[am::strings::params][am::strings::correlation_id] = kCorrelationId; - - CommandPtr command(CreateCommand<SliderRequest>(msg_)); - EXPECT_TRUE(command->Init()); - - EXPECT_CALL(app_mngr_, - updateRequestTimeout(kConnectionKey, kCorrelationId, _)); - - Event event(hmi_apis::FunctionID::UI_OnResetTimeout); - event.set_smart_object(*msg_); - command->on_event(event); -} - TEST_F(SliderRequestTest, OnEvent_UI_UnknownEventId_UNSUCCESS) { PreConditions(); EXPECT_CALL(mock_rpc_service_, ManageMobileCommand(_, _)).Times(0); diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/speak_request_test.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/speak_request_test.cc index 87320d3a7a..dd082a52a7 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/speak_request_test.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/test/commands/mobile/speak_request_test.cc @@ -366,18 +366,6 @@ TEST_F(SpeakRequestTest, OnEvent_TTS_SpeakWithWarning_WarningWithSuccess) { command->on_event(event); } -TEST_F(SpeakRequestTest, OnEvent_TTS_OnResetTimeout_UpdateTimeout) { - Event event(Event::EventID::TTS_OnResetTimeout); - (*request_)[am::strings::params][am::strings::connection_key] = - kConnectionKey; - (*request_)[am::strings::params][am::strings::correlation_id] = kAppId; - CommandPtr command(CreateCommand<SpeakRequest>(request_)); - - EXPECT_CALL(app_mngr_, updateRequestTimeout(kConnectionKey, kAppId, _)); - - command->on_event(event); -} - TEST_F(SpeakRequestTest, OnEvent_ApplicationIsNotRegistered_UNSUCCESS) { const hmi_apis::Common_Result::eType hmi_result = hmi_apis::Common_Result::SUCCESS; |