diff options
Diffstat (limited to 'src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc')
-rw-r--r-- | src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc index 87d16e87e6..4444f0d156 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc @@ -44,6 +44,8 @@ namespace commands { namespace mobile { +SDL_CREATE_LOG_VARIABLE("Commands") + OnButtonPressNotification::OnButtonPressNotification( const application_manager::commands::MessageSharedPtr& message, ApplicationManager& application_manager, @@ -59,7 +61,7 @@ OnButtonPressNotification::OnButtonPressNotification( OnButtonPressNotification::~OnButtonPressNotification() {} void OnButtonPressNotification::Run() { - LOG4CXX_AUTO_TRACE(logger_); + SDL_LOG_AUTO_TRACE(); const uint32_t btn_id = static_cast<uint32_t>( (*message_)[strings::msg_params][hmi_response::button_name].asInt()); @@ -76,20 +78,19 @@ void OnButtonPressNotification::Run() { if (static_cast<uint32_t>(mobile_apis::ButtonName::CUSTOM_BUTTON) == btn_id) { // app_id is mandatory for CUSTOM_BUTTON notification if (!is_app_id_exists) { - LOG4CXX_ERROR(logger_, "CUSTOM_BUTTON OnButtonPress without app_id."); + SDL_LOG_ERROR("CUSTOM_BUTTON OnButtonPress without app_id."); return; } // custom_button_id is mandatory for CUSTOM_BUTTON notification if (false == (*message_)[strings::msg_params].keyExists( hmi_response::custom_button_id)) { - LOG4CXX_ERROR(logger_, - "CUSTOM_BUTTON OnButtonPress without custom_button_id."); + SDL_LOG_ERROR("CUSTOM_BUTTON OnButtonPress without custom_button_id."); return; } if (!app) { - LOG4CXX_ERROR(logger_, "Application doesn't exist."); + SDL_LOG_ERROR("Application doesn't exist."); return; } @@ -99,8 +100,7 @@ void OnButtonPressNotification::Run() { .asUInt(); if (false == app->IsSubscribedToSoftButton(custom_btn_id)) { - LOG4CXX_ERROR(logger_, - "Application doesn't subscribed to this custom_button_id."); + SDL_LOG_ERROR("Application doesn't subscribed to this custom_button_id."); return; } @@ -110,9 +110,9 @@ void OnButtonPressNotification::Run() { (*message_)[strings::msg_params][strings::window_id] = window_id; const auto window_hmi_level = app->hmi_level(window_id); if ((mobile_api::HMILevel::HMI_NONE == window_hmi_level)) { - LOG4CXX_WARN(logger_, - "CUSTOM_BUTTON OnButtonPress notification is not allowed in " - "NONE hmi level"); + SDL_LOG_WARN( + "CUSTOM_BUTTON OnButtonPress notification is not allowed in " + "NONE hmi level"); return; } @@ -128,7 +128,7 @@ void OnButtonPressNotification::Run() { for (; subscribed_apps.end() != it; ++it) { ApplicationSharedPtr subscribed_app = *it; if (!subscribed_app) { - LOG4CXX_WARN(logger_, "Null pointer to subscribed app."); + SDL_LOG_WARN("Null pointer to subscribed app."); continue; } @@ -138,9 +138,8 @@ void OnButtonPressNotification::Run() { mobile_apis::PredefinedWindows::DEFAULT_WINDOW); if ((mobile_api::HMILevel::HMI_FULL != app_hmi_level) && (mobile_api::HMILevel::HMI_LIMITED != app_hmi_level)) { - LOG4CXX_WARN(logger_, - "OnButtonPress notification is allowed only" - << "in FULL or LIMITED hmi level"); + SDL_LOG_WARN("OnButtonPress notification is allowed only " + << "in FULL or LIMITED hmi level"); continue; } // if "appID" is present, send it to named app only if its FULL or @@ -160,7 +159,7 @@ void OnButtonPressNotification::Run() { void OnButtonPressNotification::SendButtonPress(ApplicationConstSharedPtr app) { if (!app) { - LOG4CXX_ERROR(logger_, "OnButtonPress NULL pointer"); + SDL_LOG_ERROR("OnButtonPress NULL pointer"); return; } @@ -168,7 +167,7 @@ void OnButtonPressNotification::SendButtonPress(ApplicationConstSharedPtr app) { std::make_shared<smart_objects::SmartObject>(); if (!on_btn_press) { - LOG4CXX_ERROR(logger_, "OnButtonPress NULL pointer"); + SDL_LOG_ERROR("OnButtonPress NULL pointer"); return; } |