Skip to content

Commit

Permalink
Answer to reviewers
Browse files Browse the repository at this point in the history
  • Loading branch information
AKalinich-Luxoft committed May 29, 2017
1 parent 553abdd commit 20a8cd4
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,29 @@ std::string MergeInfos(const std::string& first,
* @brief IsResultCodeUnsupported check if overall result code of provided infos
* is UNSUPPORTED_RESOURCE
* @param first - contains result_code from HMI response and
* interface that returns response
* interface that returns first response
* @param second - contains result_code from HMI response and
* interface that returns response
* @return true if result code UNSUPPORTED_RESOURCE otherwise false
* interface that returns second response
* @return true if overall result code is UNSUPPORTED_RESOURCE otherwise false
*/
bool IsResultCodeUnsupported(const ResponseInfo& first,
const ResponseInfo& second);

/**
* @brief IsResultCodeUnsupported check if overall result code of provided infos
* is UNSUPPORTED_RESOURCE
* @param first - contains result_code from HMI response and
* interface that returns first response
* @param second - contains result_code from HMI response and
* interface that returns second response
* @param third - contains result_code from HMI response and
* interface that returns third response
* @return true if overall result code is UNSUPPORTED_RESOURCE otherwise false
*/
bool IsResultCodeUnsupported(const ResponseInfo& first,
const ResponseInfo& second,
const ResponseInfo& third);

class CommandRequestImpl : public CommandImpl,
public event_engine::EventObserver {
public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,8 @@ class AlertManeuverRequest : public CommandRequestImpl {
* @return true if result code complies successful result code
* otherwise returns false
*/
bool PrepareResultForMobileResponse(
ResponseInfo& navigation_alert_info,
ResponseInfo& tts_alert_info) const OVERRIDE;
bool PrepareResultForMobileResponse(ResponseInfo& navigation_alert_info,
ResponseInfo& tts_alert_info) const FINAL;

/**
* @brief Checks alert maneuver params(ttsChunks, ...).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,13 @@ bool IsResultCodeUnsupported(const ResponseInfo& first,
(first.is_unsupported_resource && second.is_unsupported_resource);
}

bool IsResultCodeUnsupported(const ResponseInfo& first,
const ResponseInfo& second,
const ResponseInfo& third) {
return IsResultCodeUnsupported(first, second) ||
IsResultCodeUnsupported(second, third);
}

struct DisallowedParamsInserter {
DisallowedParamsInserter(smart_objects::SmartObject& response,
mobile_apis::VehicleDataResultCode::eType code)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ bool AlertManeuverRequest::PrepareResultForMobileResponse(
ResponseInfo& navigation_alert_info, ResponseInfo& tts_alert_info) const {
LOG4CXX_AUTO_TRACE(logger_);

const bool result = CommandRequestImpl::PrepareResultForMobileResponse(
bool result = CommandRequestImpl::PrepareResultForMobileResponse(
navigation_alert_info, tts_alert_info);
if (result && (hmi_apis::Common_Result::UNSUPPORTED_RESOURCE ==
tts_alert_info.result_code &&
Expand All @@ -218,7 +218,7 @@ bool AlertManeuverRequest::PrepareResultForMobileResponse(
HmiInterfaces::HMI_INTERFACE_TTS)))) {
tts_alert_info.result_code = hmi_apis::Common_Result::WARNINGS;
} else if (IsResultCodeUnsupported(navigation_alert_info, tts_alert_info)) {
return true;
result = true;
}

return result;
Expand Down

0 comments on commit 20a8cd4

Please sign in to comment.