Skip to content
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

Conversation

AKalinich-Luxoft
Copy link
Contributor

@AKalinich-Luxoft AKalinich-Luxoft commented May 26, 2017

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 pull request:

  • Added check for UNSUPPORTED_RESOURCE case
  • All specific checks were moved to PrepareResultForMobileResponse function
  • PrepareResultForMobileResponse is currently virtual

@AKalinich-Luxoft
Copy link
Contributor Author

@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;
}
Copy link
Contributor

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

Copy link
Contributor Author

@AKalinich-Luxoft AKalinich-Luxoft May 29, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dev-gh done as in your pull request. All specific case checks were moved from current function to virtual one. Please see 75e8ed3

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
Copy link
Contributor

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.

Copy link
Contributor Author

@AKalinich-Luxoft AKalinich-Luxoft May 29, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AKalinich-Luxoft AKalinich-Luxoft force-pushed the fix/fix_alert_maneuer_result_code branch from efb2f68 to 553abdd Compare May 29, 2017 07:04
return result;
tts_alert_info.result_code = hmi_apis::Common_Result::WARNINGS;
} else if (IsResultCodeUnsupported(navigation_alert_info, tts_alert_info)) {
return true;
Copy link

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..

Copy link
Contributor Author

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

Copy link

@ghost ghost May 29, 2017

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..

Copy link
Contributor Author

@AKalinich-Luxoft AKalinich-Luxoft May 29, 2017

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;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

@AKalinich-Luxoft AKalinich-Luxoft May 29, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@VProdanov fixed in 75e8ed3

@AKalinich-Luxoft AKalinich-Luxoft force-pushed the fix/fix_alert_maneuer_result_code branch from 20a8cd4 to 75e8ed3 Compare May 29, 2017 09:22
* interface that returns third response
* @return true if overall result code is UNSUPPORTED_RESOURCE otherwise false
*/
bool IsResultCodeUnsupported(const ResponseInfo& first,
Copy link
Contributor

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...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -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,
Copy link
Contributor

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...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -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(
Copy link
Contributor

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...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AKalinich-Luxoft AKalinich-Luxoft force-pushed the fix/fix_alert_maneuer_result_code branch from 9b902f4 to 9e2ce85 Compare May 30, 2017 10:06
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
@AKalinich-Luxoft AKalinich-Luxoft force-pushed the fix/fix_alert_maneuer_result_code branch from 9e2ce85 to d92f767 Compare May 31, 2017 15:27
@JenkinsSDLOnCloud
Copy link

Can one of the admins verify this patch?

2 similar comments
@JenkinsSDLOnCloud
Copy link

Can one of the admins verify this patch?

@JenkinsSDLOnCloud
Copy link

Can one of the admins verify this patch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants