diff options
Diffstat (limited to 'src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc')
-rw-r--r-- | src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc index 0dda8b3277..aeb53a115e 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_event_notification.cc @@ -149,7 +149,7 @@ void OnButtonEventNotification::SendButtonEvent(ApplicationConstSharedPtr app) { } smart_objects::SmartObjectSPtr on_btn_event = - new smart_objects::SmartObject(); + std::make_shared<smart_objects::SmartObject>(); if (!on_btn_event) { LOG4CXX_ERROR(logger_, "OnButtonEvent NULL pointer"); @@ -161,8 +161,16 @@ void OnButtonEventNotification::SendButtonEvent(ApplicationConstSharedPtr app) { (*on_btn_event)[strings::params][strings::function_id] = static_cast<int32_t>(mobile_apis::FunctionID::eType::OnButtonEventID); - (*on_btn_event)[strings::msg_params][strings::button_name] = - (*message_)[strings::msg_params][hmi_response::button_name]; + mobile_apis::ButtonName::eType btn_id = + static_cast<mobile_apis::ButtonName::eType>( + (*message_)[strings::msg_params][hmi_response::button_name].asInt()); + + if (btn_id == mobile_apis::ButtonName::PLAY_PAUSE && + app->msg_version() <= utils::version_4_5) { + btn_id = mobile_apis::ButtonName::OK; + } + + (*on_btn_event)[strings::msg_params][strings::button_name] = btn_id; (*on_btn_event)[strings::msg_params][strings::button_event_mode] = (*message_)[strings::msg_params][hmi_response::button_mode]; |