Skip to content

Commit

Permalink
Address Livio comments
Browse files Browse the repository at this point in the history
  • Loading branch information
AKalinich-Luxoft committed Jul 28, 2021
1 parent a327f06 commit daa1060
Showing 1 changed file with 3 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ bool ButtonNotificationToMobile::DoesParamExist(
const std::string& param_name) const {
SDL_LOG_AUTO_TRACE();
using namespace application_manager::strings;
return (*message_).keyExists(msg_params) &&
(*message_)[msg_params].keyExists(param_name);
return (*message_)[msg_params].keyExists(param_name);
}

void ButtonNotificationToMobile::HandleCustomButton(
Expand All @@ -71,12 +70,6 @@ void ButtonNotificationToMobile::HandleCustomButton(
return;
}

// app_id is mandatory for CUSTOM_BUTTON notification
if (!DoesParamExist(strings::app_id)) {
SDL_LOG_ERROR("CUSTOM_BUTTON mobile notification without app_id.");
return;
}

// custom_button_id is mandatory for CUSTOM_BUTTON notification
if (!DoesParamExist(hmi_response::custom_button_id)) {
SDL_LOG_ERROR(
Expand Down Expand Up @@ -144,7 +137,6 @@ void ButtonNotificationToMobile::HandleOKButton(
SDL_LOG_DEBUG("Sending button press for app in FULL with app id: "
<< (*app_ptr)->app_id());
SendButtonNotification(*app_ptr);
return;
} else {
SDL_LOG_ERROR("No application found");
}
Expand Down Expand Up @@ -181,19 +173,15 @@ void ButtonNotificationToMobile::HandleMediaButton(
const auto app_ptr =
std::find_if(subscribed_apps.begin(),
subscribed_apps.end(),
[](const ApplicationSharedPtr subscribed_app)

{
[](const ApplicationSharedPtr subscribed_app) {
return helpers::Compare<mobile_api::HMILevel::eType,
helpers::EQ,
helpers::ONE>(
subscribed_app->hmi_level(
mobile_apis::PredefinedWindows::DEFAULT_WINDOW),
mobile_api::HMILevel::HMI_FULL,
mobile_api::HMILevel::HMI_LIMITED);
}

);
});

if (app_ptr != subscribed_apps.end()) {
SendButtonNotification(*app_ptr);
Expand Down

0 comments on commit daa1060

Please sign in to comment.