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 UnregisterAppInterface for not found app #1572

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix UnregisterAppInterface for not found app
If an app is not found in SDL but the mobile side
sends UnregisterAppInterface, SDL creates the mobile
request but never runs it because the app is not found.
Then the request times out and the response to the
mobile side is `GENERIC_ERROR`. Now command will be
ran and the proper response of `APPLICATION_NOT_REGISTERED`
will be sent.
PVasilev committed May 29, 2017
commit de69dfe73aea68dece35d978994b6bbdf1ffae88
Original file line number Diff line number Diff line change
@@ -487,9 +487,11 @@ mobile_apis::Result::eType CommandRequestImpl::GetMobileResultCode(
bool CommandRequestImpl::CheckAllowedParameters() {
LOG4CXX_AUTO_TRACE(logger_);

// RegisterAppInterface should always be allowed
if (mobile_apis::FunctionID::RegisterAppInterfaceID ==
static_cast<mobile_apis::FunctionID::eType>(function_id())) {
// RegisterAppInterface and UnregisterAppInterface should always be allowed
const mobile_apis::FunctionID::eType func_id =
static_cast<mobile_apis::FunctionID::eType>(function_id());
if (mobile_apis::FunctionID::RegisterAppInterfaceID == func_id ||
Copy link
Contributor

Choose a reason for hiding this comment

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

@pvvasilev I propose you to use helpers::Compare here

Copy link
Author

Choose a reason for hiding this comment

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

mobile_apis::FunctionID::UnregisterAppInterfaceID == func_id) {
return true;
}