summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcollin <collin@livio.io>2020-05-19 12:14:09 -0400
committercollin <collin@livio.io>2020-05-19 12:14:09 -0400
commite0740f7526117dac670c82f626f5b6a1db747673 (patch)
treea1df2cf55ef82c5595da1c07d2f9ecda7e852575
parent99e8ddcf6cff8d205d5544e4a9ae84de3b2645c9 (diff)
downloadsdl_core-e0740f7526117dac670c82f626f5b6a1db747673.tar.gz
initialize app in non custom button path of on_button_press run
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_button_press_notification.cc7
1 files changed, 4 insertions, 3 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 c51991742d..a205660e23 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
@@ -67,6 +67,10 @@ void OnButtonPressNotification::Run() {
const bool is_app_id_exists =
(*message_)[strings::msg_params].keyExists(strings::app_id);
ApplicationSharedPtr app;
+ if (is_app_id_exists) {
+ app = application_manager_.application(
+ (*message_)[strings::msg_params][strings::app_id].asUInt());
+ }
// CUSTOM_BUTTON notification
if (static_cast<uint32_t>(mobile_apis::ButtonName::CUSTOM_BUTTON) == btn_id) {
@@ -76,9 +80,6 @@ void OnButtonPressNotification::Run() {
return;
}
- app = application_manager_.application(
- (*message_)[strings::msg_params][strings::app_id].asUInt());
-
// custom_button_id is mandatory for CUSTOM_BUTTON notification
if (false == (*message_)[strings::msg_params].keyExists(
hmi_response::custom_button_id)) {