From b4e3de2e57b141d7fa610760f5d81cf1520c8769 Mon Sep 17 00:00:00 2001 From: Herasym Oleh Date: Thu, 25 Aug 2016 10:47:54 +0300 Subject: [PATCH] Add const to value --- .../src/commands/mobile/on_button_event_notification.cc | 6 ++++-- .../src/commands/mobile/on_button_press_notification.cc | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/application_manager/src/commands/mobile/on_button_event_notification.cc b/src/components/application_manager/src/commands/mobile/on_button_event_notification.cc index e2108c3abfd..80343c2a88d 100644 --- a/src/components/application_manager/src/commands/mobile/on_button_event_notification.cc +++ b/src/components/application_manager/src/commands/mobile/on_button_event_notification.cc @@ -57,8 +57,9 @@ void OnButtonEventNotification::Run() { static_cast( (*message_)[strings::msg_params][hmi_response::button_name].asInt()); - ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application( - (*message_)[strings::msg_params][strings::app_id].asUInt()); + const ApplicationSharedPtr app = + ApplicationManagerImpl::instance()->application( + (*message_)[strings::msg_params][strings::app_id].asUInt()); // CUSTOM_BUTTON notification if (static_cast(mobile_apis::ButtonName::CUSTOM_BUTTON) == btn_id) { @@ -106,6 +107,7 @@ void OnButtonEventNotification::Run() { continue; } + // if "app_id" absent send notification only in HMI_FULL mode if (app || subscribed_app->IsFullscreen()) { // Send ButtonEvent notification only in HMI_FULL or HMI_LIMITED mode if ((mobile_api::HMILevel::HMI_FULL != subscribed_app->hmi_level()) && diff --git a/src/components/application_manager/src/commands/mobile/on_button_press_notification.cc b/src/components/application_manager/src/commands/mobile/on_button_press_notification.cc index f3726184155..fd8b2d1f835 100644 --- a/src/components/application_manager/src/commands/mobile/on_button_press_notification.cc +++ b/src/components/application_manager/src/commands/mobile/on_button_press_notification.cc @@ -57,8 +57,9 @@ void OnButtonPressNotification::Run() { static_cast( (*message_)[strings::msg_params][hmi_response::button_name].asInt()); - ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application( - (*message_)[strings::msg_params][strings::app_id].asUInt()); + const ApplicationSharedPtr app = + ApplicationManagerImpl::instance()->application( + (*message_)[strings::msg_params][strings::app_id].asUInt()); // CUSTOM_BUTTON notification if (static_cast(mobile_apis::ButtonName::CUSTOM_BUTTON) == btn_id) { @@ -106,6 +107,7 @@ void OnButtonPressNotification::Run() { continue; } + // if "app_id" absent send notification only in HMI_FULL mode if (app || subscribed_app->IsFullscreen()) { // Send ButtonEvent notification only in HMI_FULL or HMI_LIMITED mode if ((mobile_api::HMILevel::HMI_FULL != subscribed_app->hmi_level()) &&