diff options
author | Andrii Kalinich <AKalinich@luxoft.com> | 2019-07-24 15:06:45 -0400 |
---|---|---|
committer | Andriy Byzhynar (GitHub) <AByzhynar@luxoft.com> | 2019-08-20 21:17:13 +0300 |
commit | 65c409e08f50d2c6743448897bd793d9402e4463 (patch) | |
tree | adae4e1fc91664a4e5f578525b88ac6a51e53570 | |
parent | 7a85545717b20be1f778435bda3fd88b028dbd23 (diff) | |
download | sdl_core-65c409e08f50d2c6743448897bd793d9402e4463.tar.gz |
Update logic of OnSystemContext for widget windows
Updated logic for changing of the
system context for widget windows. For a some
system context types SDL is getting application
pointer not by appId from notification but
just a currently active application.
It works properly when notification is adressed
to the main window, but it works not as expected
for the widget windows. If notification contains
window id then system context change should be
addressed to the application by appId, but not
for a currently active.
-rw-r--r-- | src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_context_notification.cc | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_context_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_context_notification.cc index 055093384d..56124db96f 100644 --- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_context_notification.cc +++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/hmi/on_system_context_notification.cc @@ -62,13 +62,27 @@ void OnSystemContextNotification::Run() { (*message_)[strings::msg_params][hmi_notification::system_context] .asInt()); + WindowID window_id = mobile_apis::PredefinedWindows::DEFAULT_WINDOW; + if ((*message_)[strings::msg_params].keyExists(strings::window_id)) { + window_id = (*message_)[strings::msg_params][strings::window_id].asUInt(); + } + ApplicationSharedPtr app; - if ((mobile_api::SystemContext::SYSCTXT_VRSESSION == system_context) || - (mobile_api::SystemContext::SYSCTXT_MENU == system_context) || - (mobile_api::SystemContext::SYSCTXT_HMI_OBSCURED == system_context)) { + if (helpers:: + Compare<mobile_api::SystemContext::eType, helpers::EQ, helpers::ONE>( + system_context, + mobile_api::SystemContext::SYSCTXT_VRSESSION, + mobile_api::SystemContext::SYSCTXT_MENU, + mobile_api::SystemContext::SYSCTXT_HMI_OBSCURED)) { app = application_manager_.active_application(); - } else if ((mobile_api::SystemContext::SYSCTXT_ALERT == system_context) || - (mobile_api::SystemContext::SYSCTXT_MAIN == system_context)) { + } + + if (mobile_apis::PredefinedWindows::DEFAULT_WINDOW != window_id || + helpers::Compare<mobile_api::SystemContext::eType, + helpers::EQ, + helpers::ONE>(system_context, + mobile_api::SystemContext::SYSCTXT_ALERT, + mobile_api::SystemContext::SYSCTXT_MAIN)) { if ((*message_)[strings::msg_params].keyExists(strings::app_id)) { app = application_manager_.application( (*message_)[strings::msg_params][strings::app_id].asUInt()); @@ -76,11 +90,6 @@ void OnSystemContextNotification::Run() { } if (app && mobile_api::SystemContext::INVALID_ENUM != system_context) { - WindowID window_id = mobile_apis::PredefinedWindows::DEFAULT_WINDOW; - if ((*message_)[strings::msg_params].keyExists(strings::window_id)) { - window_id = (*message_)[strings::msg_params][strings::window_id].asUInt(); - } - application_manager_.state_controller().SetRegularState( app, window_id, system_context); } else { |