-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix AlertManeuver success result in case of UNSUPPORTED_RESOURCE #1567
Fix AlertManeuver success result in case of UNSUPPORTED_RESOURCE #1567
Conversation
@anosach-luxoft, @AByzhynar, @dev-gh, @VProdanov please review |
if (mobile_apis::Result::UNSUPPORTED_RESOURCE == result_code) { | ||
// According to APPLINK-19582 should be success:true in this case | ||
return true; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AKalinich-Luxoft
I think that is not a good approach to add more if() as this spreads special cases across different places. I propose to do changes similar to #1562 so then logic may be extended to cover specific cases for this particular command.
Also I suggest to move within these overridden method logic from lines 201-209
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
result_code = | ||
PrepareResultCodeForResponse(navigation_alert_info, tts_alert_info); | ||
return_info = | ||
MergeInfos(navigation_alert_info, info_navi_, tts_alert_info, info_tts_); | ||
|
||
if (mobile_apis::Result::UNSUPPORTED_RESOURCE == result_code) { | ||
// According to APPLINK-19582 should be success:true in this case |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AKalinich-Luxoft Remove JIRA task from comment. It is prohibited to specify such things in OpenSDL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AByzhynar done in 75e8ed3
efb2f68
to
553abdd
Compare
return result; | ||
tts_alert_info.result_code = hmi_apis::Common_Result::WARNINGS; | ||
} else if (IsResultCodeUnsupported(navigation_alert_info, tts_alert_info)) { | ||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AKalinich-Luxoft maybe result = true..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@VProdanov I think here is no difference because result will be returned as true on the next line in this case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AKalinich-Luxoft yes, its for consistency..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@VProdanov fixed in 75e8ed3
*/ | ||
bool PrepareResultForMobileResponse( | ||
ResponseInfo& navigation_alert_info, | ||
ResponseInfo& tts_alert_info) const OVERRIDE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AKalinich-Luxoft FINAL?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@VProdanov fixed in 75e8ed3
20a8cd4
to
75e8ed3
Compare
* interface that returns third response | ||
* @return true if overall result code is UNSUPPORTED_RESOURCE otherwise false | ||
*/ | ||
bool IsResultCodeUnsupported(const ResponseInfo& first, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AKalinich-Luxoft I would rename first
-> first_iface_response
and so on...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AByzhynar done in 9b902f4
75e8ed3
to
9b902f4
Compare
@@ -233,8 +260,8 @@ class CommandRequestImpl : public CommandImpl, | |||
* @return true if result code complies successful result code | |||
* otherwise returns false | |||
*/ | |||
bool PrepareResultForMobileResponse(ResponseInfo& out_first, | |||
ResponseInfo& out_second) const; | |||
virtual bool PrepareResultForMobileResponse(ResponseInfo& out_first, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AKalinich-Luxoft Please rename parameters like you did in IsResultCodeUnsupported(const ResponseInfo& first_iface_response...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AByzhynar done in 9e2ce85
@@ -256,7 +283,7 @@ class CommandRequestImpl : public CommandImpl, | |||
* interface that returns response. | |||
* @return resulting code for sending to mobile application. | |||
*/ | |||
mobile_apis::Result::eType PrepareResultCodeForResponse( | |||
virtual mobile_apis::Result::eType PrepareResultCodeForResponse( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AKalinich-Luxoft Please rename parameters like you did in IsResultCodeUnsupported(const ResponseInfo& first_iface_response...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AByzhynar done in 9e2ce85
9b902f4
to
9e2ce85
Compare
Fixed AlertManeuver success result in case of UNSUPPORTED_RESOURCE. The problem was that SDL does not check success result in this specific case. In this commit: - Added check for UNSUPPORTED_RESOURCE case - All specific checks were moved to PrepareResultForMobileResponse/PrepareResultCodeForResponse function - PrepareResultForMobileResponse is currently virtual
9e2ce85
to
d92f767
Compare
Can one of the admins verify this patch? |
2 similar comments
Can one of the admins verify this patch? |
Can one of the admins verify this patch? |
Fixed
AlertManeuver
success result in case ofUNSUPPORTED_RESOURCE
.The problem was that SDL does not check success result in this specific case.
In this pull request:
UNSUPPORTED_RESOURCE
casePrepareResultForMobileResponse
functionPrepareResultForMobileResponse
is currently virtual