summaryrefslogtreecommitdiff
path: root/src/components/application_manager/src/commands/mobile/on_button_press_notification.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/application_manager/src/commands/mobile/on_button_press_notification.cc')
-rw-r--r--src/components/application_manager/src/commands/mobile/on_button_press_notification.cc13
1 files changed, 7 insertions, 6 deletions
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 cfafc7af1..86fe664f8 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
@@ -51,7 +51,7 @@ OnButtonPressNotification::~OnButtonPressNotification() {
}
void OnButtonPressNotification::Run() {
- LOG4CXX_INFO(logger_, "OnButtonPressNotification::Run");
+ LOG4CXX_AUTO_TRACE(logger_);
const uint32_t btn_id =
static_cast<uint32_t>(
@@ -124,18 +124,19 @@ void OnButtonPressNotification::Run() {
}
void OnButtonPressNotification::SendButtonPress(ApplicationConstSharedPtr app) {
- smart_objects::SmartObject* on_btn_press = new smart_objects::SmartObject();
-
- if (!on_btn_press) {
+ if (!app) {
LOG4CXX_ERROR_EXT(logger_, "OnButtonPress NULL pointer");
return;
}
- if (!app) {
+ smart_objects::SmartObjectSPtr on_btn_press = new smart_objects::SmartObject();
+
+ if (!on_btn_press) {
LOG4CXX_ERROR_EXT(logger_, "OnButtonPress NULL pointer");
return;
}
+
(*on_btn_press)[strings::params][strings::connection_key] = app->app_id();
(*on_btn_press)[strings::params][strings::function_id] =
@@ -152,7 +153,7 @@ void OnButtonPressNotification::SendButtonPress(ApplicationConstSharedPtr app) {
(*message_)[strings::msg_params][strings::custom_button_id];
}
- message_.reset(on_btn_press);
+ message_ = on_btn_press;
SendNotification();
}