diff options
author | Madhu Yaduguri <madhuyaduguri@UIE08563.lan> | 2016-06-07 04:47:21 -0700 |
---|---|---|
committer | Jacob Keeler <jacob.keeler@livioradio.com> | 2016-11-04 13:46:20 -0400 |
commit | c0e8117ca2a4302cd094c9e449c28aa9b5a4defb (patch) | |
tree | 7b1a7a485adb0cfb1b47efe0ae89fe0caa8587c4 /src/components | |
parent | 38471c26a25e7285ced2f57c23b3ed0d71d70b4c (diff) | |
download | sdl_core-c0e8117ca2a4302cd094c9e449c28aa9b5a4defb.tar.gz |
updating as per review comments and fixing bug in case of background apphotfix/on_button_press_conditions
Diffstat (limited to 'src/components')
-rwxr-xr-x | src/components/application_manager/src/commands/mobile/on_button_press_notification.cc | 27 |
1 files changed, 12 insertions, 15 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 8c5600ec14..b789b7c7e9 100755 --- 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 @@ -59,9 +59,6 @@ void OnButtonPressNotification::Run() { const ApplicationSharedPtr app = application_manager_.application( (*message_)[strings::msg_params][strings::app_id].asUInt()); - ApplicationSharedPtr app = ApplicationManagerImpl::instance()->application( - (*message_)[strings::msg_params][strings::app_id].asUInt()); - // CUSTOM_BUTTON notification if (static_cast<uint32_t>(mobile_apis::ButtonName::CUSTOM_BUTTON) == btn_id) { // app_id is mandatory for CUSTOM_BUTTON notification @@ -111,21 +108,21 @@ void OnButtonPressNotification::Run() { continue; } + // Send ButtonPress notification only in HMI_FULL or HMI_LIMITED mode + if ((mobile_api::HMILevel::HMI_FULL != subscribed_app->hmi_level()) && + (mobile_api::HMILevel::HMI_LIMITED != subscribed_app->hmi_level())) { + LOG4CXX_WARN(logger_, + "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 + // LIMITED if (app.valid()) { - // Send ButtonPress notification only in HMI_FULL or HMI_LIMITED mode - if ((mobile_api::HMILevel::HMI_FULL != subscribed_app->hmi_level()) && - (mobile_api::HMILevel::HMI_LIMITED != subscribed_app->hmi_level())) { - LOG4CXX_WARN(logger_, - "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 - // LIMITED - if (app == subscribed_app) { + if (app->app_id() == subscribed_app->app_id()) { SendButtonPress(subscribed_app); } - } else if (mobile_api::HMILevel::HMI_FULL == subscribed_app->hmi_level()) { + } else if (subscribed_app->IsFullscreen()) { // if No "appID" - send it FULL apps only. SendButtonPress(subscribed_app); } |