From 527c3d63896e82008582bfabf45f40150d930465 Mon Sep 17 00:00:00 2001 From: Alexander Kutsan Date: Wed, 12 Oct 2016 14:13:09 +0300 Subject: Send language param in RAI response if TTS is available Related issue : APPLINK-28819 --- .../src/commands/mobile/register_app_interface_request.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 34c0863ddf..9c03e3b600 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 @@ -312,6 +312,11 @@ void RegisterAppInterfaceRequest::Run() { SendRegisterAppInterfaceResponseToMobile(); } +void FillTTSRelatedFields(smart_objects::SmartObject& response_params, + const HMICapabilities& hmi_capabilities) { + response_params[strings::language] = hmi_capabilities.active_tts_language(); +} + void FillVRRelatedFields(smart_objects::SmartObject& response_params, const HMICapabilities& hmi_capabilities) { response_params[strings::language] = hmi_capabilities.active_vr_language(); @@ -456,6 +461,12 @@ void RegisterAppInterfaceRequest::SendRegisterAppInterfaceResponseToMobile() { result_code = mobile_apis::Result::WRONG_LANGUAGE; } + if (HmiInterfaces::STATE_NOT_AVAILABLE != + application_manager_.hmi_interfaces().GetInterfaceState( + HmiInterfaces::HMI_INTERFACE_TTS)) { + FillTTSRelatedFields(response_params, hmi_capabilities); + } + if (HmiInterfaces::STATE_NOT_AVAILABLE != application_manager_.hmi_interfaces().GetInterfaceState( HmiInterfaces::HMI_INTERFACE_VR)) { -- cgit v1.2.1