summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTeodora Kireva (GitHub) <tkireva@luxoft.com>2017-01-23 15:16:54 +0200
committerGitHub <noreply@github.com>2017-01-23 15:16:54 +0200
commita89a0768020ee0e58246d408efb99e9fa6478bc3 (patch)
tree67580651a85db24f4b289809b7c68ab751b608c9
parent8606829ce09211d776433d04cb27ef2623165e5e (diff)
downloadsdl_core-revert-1182-feature/audio_pass_thru_param.tar.gz
Revert "Add support for audioPassThruIcon parameter"revert-1182-feature/audio_pass_thru_param
-rw-r--r--src/components/application_manager/include/application_manager/commands/command_request_impl.h24
-rw-r--r--src/components/application_manager/include/application_manager/commands/mobile/perform_audio_pass_thru_request.h46
-rw-r--r--src/components/application_manager/include/application_manager/smart_object_keys.h1
-rw-r--r--src/components/application_manager/src/commands/command_request_impl.cc37
-rw-r--r--src/components/application_manager/src/commands/mobile/perform_audio_pass_thru_request.cc154
-rw-r--r--src/components/application_manager/src/smart_object_keys.cc4
-rw-r--r--src/components/interfaces/HMI_API.xml16
-rw-r--r--src/components/interfaces/MOBILE_API.xml8
8 files changed, 48 insertions, 242 deletions
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 db9203a8fc..f585410e97 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
@@ -259,30 +259,6 @@ class CommandRequestImpl : public CommandImpl,
mobile_apis::Result::eType PrepareResultCodeForResponse(
const ResponseInfo& first, const ResponseInfo& second);
- /**
- * @brief Resolves if the return code must be
- * UNSUPPORTED_RESOURCE
- * @param first contains result_code from HMI response and
- * interface that returns response
- * @param second contains result_code from HMI response and
- * interface that returns response.
- * @return if the communication return code must be
- * UNSUPPORTED_RESOURCE, function returns true, else
- * false
- */
- bool IsResultCodeUnsupported(const ResponseInfo& first,
- const ResponseInfo& second) const;
- /**
- * @brief Checks result code from HMI for split RPC
- * and set flags to the info structures.
- * @param first contains result_code from HMI response and
- * interface that returns response
- * @param second contains result_code from HMI response and
- * interface that returns response
- */
- void SetResultCodeFlagsForHMIResponses(ResponseInfo& out_first,
- ResponseInfo& out_second) const;
-
protected:
/**
* @brief Returns policy parameters permissions
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 085de255bb..aff7430c6a 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
@@ -133,57 +133,11 @@ class PerformAudioPassThruRequest : public CommandRequestImpl {
*/
bool IsWaitingHMIResponse();
- /**
- * @brief Validates audioPassThruIcon parameter and
- * removes it if is not valid
- * @param app Pointer to the application whose storage directory
- * must be accessed
- */
- void ProcessAudioPassThruIcon(ApplicationSharedPtr app);
-
- /**
- * @brief Checks if the audioPassThruIcon parameter value
- * contains special characters (\n,\t) or
- * contains only white spaces
- * @return If the audioPassthruIcon parameter value contains
- * above mentioned symbols, the function returns FALSE, else
- * the parameter value is valid and it returns TRUE
- */
- bool IsAudioPassThruIconParamValid();
-
- /**
- * @brief Checks result code from HMI for splitted RPC
- * and returns parameter for sending to mobile app in
- * audioPassThru communication.
- * @param ui_response contains result_code from UI
- * @param tts_response contains result_code from TTS
- * @return result code - 1) UI error code has precedence than TTS's
- * 2) error_code from TTS is turned to WARNINGS
- */
- mobile_apis::Result::eType PrepareAudioPassThruResultCodeForResponse(
- const ResponseInfo& ui_response, const ResponseInfo& tts_response);
-
- /**
- * @brief Checks if any of audioPassThru communication components
- * returned ABORTED code
- * @param ui contains result_code from UI
- * @param tts contains result_code from TTS
- * @return if TTS or UI responded with ABORTED function returns TRUE,
- * else is returns FALSE
- */
- bool IsAnyHMIComponentAborted(const ResponseInfo& ui,
- const ResponseInfo& tts);
-
/* flag display state of speak and ui perform audio
during perform audio pass thru*/
bool awaiting_tts_speak_response_;
bool awaiting_ui_response_;
- /* flag shows if last received audioPassThruIcon exists
- * in the file system
- */
- bool audio_pass_thru_icon_exists_;
-
hmi_apis::Common_Result::eType result_tts_speak_;
hmi_apis::Common_Result::eType result_ui_;
std::string ui_info_;
diff --git a/src/components/application_manager/include/application_manager/smart_object_keys.h b/src/components/application_manager/include/application_manager/smart_object_keys.h
index 66ba4aa484..a1639eebd8 100644
--- a/src/components/application_manager/include/application_manager/smart_object_keys.h
+++ b/src/components/application_manager/include/application_manager/smart_object_keys.h
@@ -164,7 +164,6 @@ extern const char* speech_capabilities;
extern const char* vr_capabilities;
extern const char* audio_pass_thru_capabilities;
extern const char* pcm_stream_capabilities;
-extern const char* audio_pass_thru_icon;
// PutFile
extern const char* sync_file_name;
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 1c89f30c5e..1c966ef4dc 100644
--- a/src/components/application_manager/src/commands/command_request_impl.cc
+++ b/src/components/application_manager/src/commands/command_request_impl.cc
@@ -109,6 +109,15 @@ bool CheckResultCode(const ResponseInfo& first, const ResponseInfo& second) {
return false;
}
+bool IsResultCodeUnsupported(const ResponseInfo& first,
+ const ResponseInfo& second) {
+ return ((first.is_ok || first.is_invalid_enum) &&
+ second.is_unsupported_resource) ||
+ ((second.is_ok || second.is_invalid_enum) &&
+ first.is_unsupported_resource) ||
+ (first.is_unsupported_resource && second.is_unsupported_resource);
+}
+
struct DisallowedParamsInserter {
DisallowedParamsInserter(smart_objects::SmartObject& response,
mobile_apis::VehicleDataResultCode::eType code)
@@ -681,18 +690,6 @@ bool CommandRequestImpl::PrepareResultForMobileResponse(
bool CommandRequestImpl::PrepareResultForMobileResponse(
ResponseInfo& out_first, ResponseInfo& out_second) const {
- SetResultCodeFlagsForHMIResponses(out_first, out_second);
-
- bool result = (out_first.is_ok && out_second.is_ok) ||
- (out_second.is_invalid_enum && out_first.is_ok) ||
- (out_first.is_invalid_enum && out_second.is_ok);
- result = result || CheckResultCode(out_first, out_second);
- result = result || CheckResultCode(out_second, out_first);
- return result;
-}
-
-void CommandRequestImpl::SetResultCodeFlagsForHMIResponses(
- ResponseInfo& out_first, ResponseInfo& out_second) const {
using namespace helpers;
out_first.is_ok = Compare<hmi_apis::Common_Result::eType, EQ, ONE>(
@@ -729,6 +726,13 @@ void CommandRequestImpl::SetResultCodeFlagsForHMIResponses(
out_second.interface_state =
application_manager_.hmi_interfaces().GetInterfaceState(
out_second.interface);
+
+ bool result = (out_first.is_ok && out_second.is_ok) ||
+ (out_second.is_invalid_enum && out_first.is_ok) ||
+ (out_first.is_invalid_enum && out_second.is_ok);
+ result = result || CheckResultCode(out_first, out_second);
+ result = result || CheckResultCode(out_second, out_first);
+ return result;
}
void CommandRequestImpl::GetInfo(
@@ -771,15 +775,6 @@ const CommandParametersPermissions& CommandRequestImpl::parameters_permissions()
return parameters_permissions_;
}
-bool CommandRequestImpl::IsResultCodeUnsupported(
- const ResponseInfo& first, const ResponseInfo& second) const {
- return ((first.is_ok || first.is_invalid_enum) &&
- second.is_unsupported_resource) ||
- ((second.is_ok || second.is_invalid_enum) &&
- first.is_unsupported_resource) ||
- (first.is_unsupported_resource && second.is_unsupported_resource);
-}
-
} // namespace commands
} // namespace application_manager
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 8a631ec393..9f5fd937f9 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
@@ -37,7 +37,6 @@
#include "application_manager/application_impl.h"
#include "application_manager/message_helper.h"
#include "utils/helpers.h"
-#include "utils/file_system.h"
namespace application_manager {
@@ -50,7 +49,6 @@ PerformAudioPassThruRequest::PerformAudioPassThruRequest(
: CommandRequestImpl(message, application_manager)
, awaiting_tts_speak_response_(false)
, awaiting_ui_response_(false)
- , audio_pass_thru_icon_exists_(true)
, 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);
@@ -99,7 +97,6 @@ void PerformAudioPassThruRequest::Run() {
// According with new implementation processing of UNSUPPORTE_RESOURCE
// need set flag before sending to hmi
- ProcessAudioPassThruIcon(app);
awaiting_ui_response_ = true;
if ((*message_)[str::msg_params].keyExists(str::initial_prompt) &&
(0 < (*message_)[str::msg_params][str::initial_prompt].length())) {
@@ -196,34 +193,21 @@ bool PerformAudioPassThruRequest::PrepareResponseParameters(
mobile_apis::Result::eType& result_code, std::string& info) {
LOG4CXX_AUTO_TRACE(logger_);
- bool result = true;
ResponseInfo ui_perform_info(result_ui_, HmiInterfaces::HMI_INTERFACE_UI);
ResponseInfo tts_perform_info(result_tts_speak_,
HmiInterfaces::HMI_INTERFACE_TTS);
+ const bool result =
+ PrepareResultForMobileResponse(ui_perform_info, tts_perform_info);
- SetResultCodeFlagsForHMIResponses(ui_perform_info, tts_perform_info);
if (ui_perform_info.is_ok && tts_perform_info.is_unsupported_resource &&
HmiInterfaces::STATE_AVAILABLE == tts_perform_info.interface_state) {
result_code = mobile_apis::Result::WARNINGS;
tts_info_ = "Unsupported phoneme type sent in a prompt";
- } else if (IsResultCodeUnsupported(ui_perform_info, tts_perform_info)) {
- result_code = mobile_apis::Result::UNSUPPORTED_RESOURCE;
- } else if (IsAnyHMIComponentAborted(ui_perform_info, tts_perform_info)) {
- result_code = mobile_apis::Result::ABORTED;
- result = false;
- } else {
- result_code = PrepareAudioPassThruResultCodeForResponse(ui_perform_info,
- tts_perform_info);
- if (!ui_perform_info.is_ok) {
- result = false;
- }
+ info = MergeInfos(ui_perform_info, ui_info_, tts_perform_info, tts_info_);
+ return result;
}
-
+ result_code = PrepareResultCodeForResponse(ui_perform_info, tts_perform_info);
info = MergeInfos(ui_perform_info, ui_info_, tts_perform_info, tts_info_);
- if (!audio_pass_thru_icon_exists_) {
- info = MergeInfos("Reference image(s) not found", info);
- }
-
return result;
}
@@ -252,53 +236,45 @@ void PerformAudioPassThruRequest::SendSpeakRequest() {
void PerformAudioPassThruRequest::SendPerformAudioPassThruRequest() {
LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObject msg_params_send =
+ smart_objects::SmartObject msg_params =
smart_objects::SmartObject(smart_objects::SmartType_Map);
- smart_objects::SmartObject msg_params_rcvd = (*message_)[str::msg_params];
- msg_params_send[str::app_id] = connection_key();
+ msg_params[str::app_id] = connection_key();
- msg_params_send[hmi_request::max_duration] =
- msg_params_rcvd[str::max_duration];
+ msg_params[hmi_request::max_duration] =
+ (*message_)[str::msg_params][str::max_duration];
- msg_params_send[hmi_request::audio_pass_display_texts] =
+ msg_params[hmi_request::audio_pass_display_texts] =
smart_objects::SmartObject(smart_objects::SmartType_Array);
- if (msg_params_rcvd.keyExists(str::audio_pass_display_text1)) {
- msg_params_send
- [hmi_request::audio_pass_display_texts][0][hmi_request::field_name] =
- static_cast<int32_t>(
- hmi_apis::Common_TextFieldName::audioPassThruDisplayText1);
- msg_params_send[hmi_request::audio_pass_display_texts][0]
- [hmi_request::field_text] =
- msg_params_rcvd[str::audio_pass_display_text1];
+ 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];
}
- if (msg_params_rcvd.keyExists(str::audio_pass_display_text2)) {
- msg_params_send
- [hmi_request::audio_pass_display_texts][1][hmi_request::field_name] =
- static_cast<int32_t>(
- hmi_apis::Common_TextFieldName::audioPassThruDisplayText2);
- msg_params_send[hmi_request::audio_pass_display_texts][1]
- [hmi_request::field_text] =
- msg_params_rcvd[str::audio_pass_display_text2];
+ 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];
}
- if (msg_params_rcvd.keyExists(str::mute_audio)) {
- msg_params_send[str::mute_audio] =
- msg_params_rcvd[str::mute_audio].asBool();
+ if ((*message_)[str::msg_params].keyExists(str::mute_audio)) {
+ msg_params[str::mute_audio] =
+ (*message_)[str::msg_params][str::mute_audio].asBool();
} else {
// If omitted, the value is set to true
- msg_params_send[str::mute_audio] = true;
- }
-
- if (msg_params_rcvd.keyExists(str::audio_pass_thru_icon)) {
- msg_params_send[str::audio_pass_thru_icon] =
- msg_params_rcvd[str::audio_pass_thru_icon];
+ msg_params[str::mute_audio] = true;
}
SendHMIRequest(
- hmi_apis::FunctionID::UI_PerformAudioPassThru, &msg_params_send, true);
+ hmi_apis::FunctionID::UI_PerformAudioPassThru, &msg_params, true);
}
void PerformAudioPassThruRequest::SendRecordStartNotification() {
@@ -389,78 +365,6 @@ bool PerformAudioPassThruRequest::IsWaitingHMIResponse() {
return awaiting_tts_speak_response_ || awaiting_ui_response_;
}
-void PerformAudioPassThruRequest::ProcessAudioPassThruIcon(
- ApplicationSharedPtr app) {
- LOG4CXX_AUTO_TRACE(logger_);
- smart_objects::SmartObject msg_params = (*message_)[strings::msg_params];
-
- audio_pass_thru_icon_exists_ = true;
- if (msg_params.keyExists(strings::audio_pass_thru_icon)) {
- if (IsAudioPassThruIconParamValid()) {
- smart_objects::SmartObject icon =
- msg_params[strings::audio_pass_thru_icon];
- if (MessageHelper::VerifyImage(icon, app, application_manager_) !=
- mobile_apis::Result::SUCCESS) {
- LOG4CXX_WARN(
- logger_,
- "Invalid audio_pass_thru_icon doesn't exist in the file system");
- audio_pass_thru_icon_exists_ = false;
- }
- } else {
- LOG4CXX_WARN(logger_,
- "Invalid audio_pass_thru_icon validation check failed");
- msg_params.erase(strings::audio_pass_thru_icon);
- }
- }
-}
-
-mobile_apis::Result::eType
-PerformAudioPassThruRequest::PrepareAudioPassThruResultCodeForResponse(
- const ResponseInfo& ui_response, const ResponseInfo& tts_response) {
- mobile_apis::Result::eType result_code = mobile_apis::Result::INVALID_ENUM;
-
- hmi_apis::Common_Result::eType common_result =
- hmi_apis::Common_Result::INVALID_ENUM;
- const hmi_apis::Common_Result::eType ui_result = ui_response.result_code;
- const hmi_apis::Common_Result::eType tts_result = tts_response.result_code;
-
- if ((ui_result == hmi_apis::Common_Result::SUCCESS) &&
- (tts_result != hmi_apis::Common_Result::SUCCESS)) {
- common_result = hmi_apis::Common_Result::WARNINGS;
- } else if (ui_result == hmi_apis::Common_Result::INVALID_ENUM) {
- common_result = tts_result;
- } else {
- common_result = ui_result;
- }
-
- result_code = MessageHelper::HMIToMobileResult(common_result);
- return result_code;
-}
-
-bool PerformAudioPassThruRequest::IsAudioPassThruIconParamValid() {
- LOG4CXX_AUTO_TRACE(logger_);
-
- const std::string& value =
- (*message_)[strings::msg_params][strings::audio_pass_thru_icon]
- [strings::value].asString();
-
- if (!CheckSyntax(value, false)) {
- LOG4CXX_WARN(logger_,
- "Invalid audio_pass_thru_icon value syntax check failed");
- return false;
- }
-
- return true;
-}
-
-bool PerformAudioPassThruRequest::IsAnyHMIComponentAborted(
- const ResponseInfo& ui, const ResponseInfo& tts) {
- using namespace helpers;
-
- return ((ui.result_code == hmi_apis::Common_Result::ABORTED) ||
- (tts.result_code == hmi_apis::Common_Result::ABORTED));
-}
-
} // namespace commands
} // namespace application_manager
diff --git a/src/components/application_manager/src/smart_object_keys.cc b/src/components/application_manager/src/smart_object_keys.cc
index d9c851b9ad..68a3a7d424 100644
--- a/src/components/application_manager/src/smart_object_keys.cc
+++ b/src/components/application_manager/src/smart_object_keys.cc
@@ -131,7 +131,6 @@ const char* speech_capabilities = "speechCapabilities";
const char* vr_capabilities = "vrCapabilities";
const char* audio_pass_thru_capabilities = "audioPassThruCapabilities";
const char* pcm_stream_capabilities = "pcmStreamCapabilities";
-const char* audio_pass_thru_icon = "audioPassThruIcon";
// PutFile
const char* sync_file_name = "syncFileName";
const char* file_name = "fileName";
@@ -349,7 +348,6 @@ const char* auto_complete_text = "autoCompleteText";
const char* file = "file";
const char* retry = "retry";
const char* service = "service";
-const char* audio_pass_thru_icon = "audioPassThruIcon";
} // namespace hmi_request
namespace hmi_response {
@@ -408,4 +406,4 @@ const char* event_name = "eventName";
} // namespace hmi_notification
-} // namespace application_manager
+} // namespace application_manager \ No newline at end of file
diff --git a/src/components/interfaces/HMI_API.xml b/src/components/interfaces/HMI_API.xml
index adc5c772b7..1398941eff 100644
--- a/src/components/interfaces/HMI_API.xml
+++ b/src/components/interfaces/HMI_API.xml
@@ -34,7 +34,7 @@
<interfaces name="SmartDeviceLink HMI API">
-<interface name="Common" version="1.5" date="2017-01-16">
+<interface name="Common" version="1.4" date="2016-05-11">
<enum name="Result">
<element name="SUCCESS" value="0"/>
@@ -497,9 +497,6 @@
<element name="phoneNumber">
<description> Optional hone number of intended location / establishment (if applicable) for SendLocation.</description>
</element>
- <element name="audioPassThruIcon">
- <description>The optional image field for AudioPassThru</description>
- </element>
<element name="timeToDestination"/>
<!-- TO DO to be removed -->
<element name="turnText"/>
@@ -542,9 +539,6 @@
<element name="locationImage">
<description>The optional image of a destination / location</description>
</element>
- <element name="audiPassThruIcon">
- <description>The optional image for AudioPassThru</description>
- </element>
</enum>
<enum name="TextAlignment">
@@ -2733,7 +2727,7 @@
</function>
</interface>
-<interface name="UI" version="1.1" date="2017-01-16">
+<interface name="UI" version="1.0" date="2013-04-16">
<function name="Alert" messagetype="request">
<description>Request from SDL to show an alert message on the display.</description>
<param name="alertStrings" type="Common.TextFieldStruct" mandatory="true" array="true" minsize="0" maxsize="3">
@@ -3184,12 +3178,6 @@
If omitted, the value is set to true.
</description>
</param>
- <param name="audioPassThruIcon" type="Common.Image" mandatory="false">
- <description>
- Image struct determinig wheter static or dynamic icon.
- If omitted on supported displays, no (or the default if applicable) icon shall be displayed.
- </description>
- </param>
</function>
<function name="PerformAudioPassThru" messagetype="response">
</function>
diff --git a/src/components/interfaces/MOBILE_API.xml b/src/components/interfaces/MOBILE_API.xml
index 4912514fea..3bf347b605 100644
--- a/src/components/interfaces/MOBILE_API.xml
+++ b/src/components/interfaces/MOBILE_API.xml
@@ -747,10 +747,6 @@
<description>The optional image of a destination / location</description>
</element>
- <element name="audioPassThruIcon">
- <description>The optional image field for AudioPassThru</description>
- </element>
-
</enum>
<enum name="CharacterSet">
@@ -3398,10 +3394,6 @@
If omitted, the value is set to true.
</description>
</param>
- <param name="audioPassThruIcon" type="Image" mandatory="false">
- <description>Image struct determinig wheter static or dynamic icon.
- If omitted on supported displays, no (or the default if applicable) icon shall be displayed.</description>
- </param>
</function>
<function name="PerformAudioPassThru" functionID="PerformAudioPassThruID" messagetype="response">